Lasagne 与 Theano 可能的版本不匹配 (Windows)
Lasagne vs Theano possible version mismatch (Windows)
所以我终于成功地使用 this 指南在 GPU 上启动了 theano 和 运行。 (测试代码运行良好,告诉我它使用了 GPU,耶!!)
然后我想尝试一下并遵循 this 训练 CNN 数字识别的指南。
问题是:我从 lasagne 调用 theano 的方式中得到错误(我猜这里有版本不匹配):
Using gpu device 0: GeForce GT 730M (CNMeM is disabled, cuDNN not available)
Traceback (most recent call last):
File "C:\Users\Soren Jensen\Desktop\CNN-test\CNNTest-one.py", line 7, in <module>
import lasagne
File "C:\Users\Soren Jensen\Anaconda3\lib\site-packages\lasagne\__init__.py", line 19, in <module>
from . import layers
File "C:\Users\Soren Jensen\Anaconda3\lib\site-packages\lasagne\layers\__init__.py", line 7, in <module>
from .pool import *
File "C:\Users\Soren Jensen\Anaconda3\lib\site-packages\lasagne\layers\pool.py", line 6, in <module>
from theano.tensor.signal import downsample
ImportError: cannot import name 'downsample'
Press any key to continue . . .
从错误信息来看,似乎 'downsample' 被更改了,为什么我的烤宽面条还在调用它??
尝试更新我的烤宽面条版本:
C:\WINDOWS\system32>pip3.5 install Lasagne==0.1
Collecting Lasagne==0.1
Requirement already satisfied: numpy in c:\users\soren jensen\anaconda3\lib\site-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_compiledir\compiledir_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:\Users\Soren Jensen\Anaconda3\lib\site-packages\theano\theano
Press any key to continue . . .
抱歉这么久了 post,但我对这行不通有点发疯了。也许我在版本不匹配方面错了,错误是别的什么?
尝试像这样重新安装 Theano 和 Lasagne:
pip install --upgrade https://github.com/Theano/Theano/archive/master.zip
pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip
因为:"An even more recent version of Theano will often work as well, but at the time of writing, a simple pip install Theano will give you a version that is too old."
阅读更多:lasagne.readthedocs.io/en/latest/user/installation.html
所以我终于成功地使用 this 指南在 GPU 上启动了 theano 和 运行。 (测试代码运行良好,告诉我它使用了 GPU,耶!!) 然后我想尝试一下并遵循 this 训练 CNN 数字识别的指南。
问题是:我从 lasagne 调用 theano 的方式中得到错误(我猜这里有版本不匹配):
Using gpu device 0: GeForce GT 730M (CNMeM is disabled, cuDNN not available)
Traceback (most recent call last):
File "C:\Users\Soren Jensen\Desktop\CNN-test\CNNTest-one.py", line 7, in <module>
import lasagne
File "C:\Users\Soren Jensen\Anaconda3\lib\site-packages\lasagne\__init__.py", line 19, in <module>
from . import layers
File "C:\Users\Soren Jensen\Anaconda3\lib\site-packages\lasagne\layers\__init__.py", line 7, in <module>
from .pool import *
File "C:\Users\Soren Jensen\Anaconda3\lib\site-packages\lasagne\layers\pool.py", line 6, in <module>
from theano.tensor.signal import downsample
ImportError: cannot import name 'downsample'
Press any key to continue . . .
从错误信息来看,似乎 'downsample' 被更改了,为什么我的烤宽面条还在调用它??
尝试更新我的烤宽面条版本:
C:\WINDOWS\system32>pip3.5 install Lasagne==0.1
Collecting Lasagne==0.1
Requirement already satisfied: numpy in c:\users\soren jensen\anaconda3\lib\site-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_compiledir\compiledir_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:\Users\Soren Jensen\Anaconda3\lib\site-packages\theano\theano
Press any key to continue . . .
抱歉这么久了 post,但我对这行不通有点发疯了。也许我在版本不匹配方面错了,错误是别的什么?
尝试像这样重新安装 Theano 和 Lasagne:
pip install --upgrade https://github.com/Theano/Theano/archive/master.zip
pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip
因为:"An even more recent version of Theano will often work as well, but at the time of writing, a simple pip install Theano will give you a version that is too old."
阅读更多:lasagne.readthedocs.io/en/latest/user/installation.html