加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

python-3.x – Lasagne与Theano可能的版本不匹配(Windows)

发布时间:2020-12-20 11:58:49 所属栏目:Python 来源:网络整理
导读:所以我终于设法使用 this指南让theano在GPU上运行. (测试代码运行正常,告诉我它使用了GPU,YAY !!) 然后,我想尝试一下,并按照 this指南培训CNN数字识别. 问题是:我从lasagne调用theano的方式得到错误(我猜这里有版本不匹配): Using gpu device 0: GeForce G
所以我终于设法使用 this指南让theano在GPU上运行. (测试代码运行正常,告诉我它使用了GPU,YAY !!)
然后,我想尝试一下,并按照 this指南培训CNN数字识别.

问题是:我从lasagne调用theano的方式得到错误(我猜这里有版本不匹配):

Using gpu device 0: GeForce GT 730M (CNMeM is disabled,cuDNN not available)
Traceback (most recent call last):
File "C:UsersSoren JensenDesktopCNN-testCNNTest-one.py",line 7,in <module>
import lasagne
File "C:UsersSoren JensenAnaconda3libsite-packageslasagne__init__.py",line 19,in <module>
from . import layers
File "C:UsersSoren JensenAnaconda3libsite-packageslasagnelayers__init__.py",in <module>
from .pool import *
File "C:UsersSoren JensenAnaconda3libsite-packageslasagnelayerspool.py",line 6,in <module>
from theano.tensor.signal import downsample
ImportError: cannot import name 'downsample'
Press any key to continue . . .

从阅读有关错误信息,似乎“缩减样本”被改变,那么为什么我的千层面仍然在调用它?

试图更新我的烤宽面条版本给出:

C:WINDOWSsystem32>pip3.5 install Lasagne==0.1
Collecting Lasagne==0.1
Requirement already satisfied: numpy in c:userssoren jensenanaconda3libsite-packages (from Lasagne==0.1)

并运行代码示例

import theano
import os
print(theano.config.compiledir)

print("Theano version %s" % theano.__version__)
theano_dir = os.path.dirname(theano.__file__)
print("theano is installed in %s" % theano_dir)

揭示python3.5使用theano v 0.9

Using gpu device 0: GeForce GT 730M (CNMeM is disabled,cuDNN not available)
C:theano_compiledircompiledir_Windows-10-10.0.14393-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.5.2-64
Theano version 0.9.0.dev-e5bedc0de240eca42433c34c05fc00f4a5ef6cbe
theano is installed in C:UsersSoren JensenAnaconda3libsite-packagestheanotheano
Press any key to continue . . .

很抱歉很长的帖子,但我有点疯狂,这不工作..也许我错了版本不匹配,错误是别的吗?

解决方法

尝试重新安装Theano和Lasagne,如下所示:

pip install --upgrade https://github.com/Theano/Theano/archive/master.zip
pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip

因为:“Theano的更新版本通常也会起作用,但在撰写本文时,一个简单的点子安装Theano会给你一个太老的版本.”

阅读更多:lasagne.readthedocs.io/en/latest/user/installation.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读