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

标签 python-3.x theano lasagne

所以我终于设法使用 this 在 GPU 上启动并运行 theano指导。 (测试代码运行良好,告诉我它使用了 GPU,耶!!) 然后我想尝试一下并关注 this CNN 数字识别训练指南。

问题是:我从千层面调用 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 . . .

很抱歉,这篇文章太长了,但我对这不起作用有点疯狂。也许我在版本不匹配方面错了,错误是别的什么?

最佳答案

尝试像这样重新安装 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 版本通常也可以正常工作,但在撰写本文时,一个简单的 pip install Theano 会给你一个太旧的版本。”

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

关于python-3.x - Lasagne 与 Theano 可能的版本不匹配(Windows),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42998355/

相关文章:

python - psycopg2、pymc、theano 和 DYLD_FALLBACK_LIBRARY_PATH

python - 访问 keras 模型输出相对于输入的梯度值

python - 将文件名从大写重命名为小写

linux - 无需密码即可远程关闭/重启 Linux 机器

neural-network - 不使用 GPU 的 Keras 神经网络模型预测

python - Lasagne/Theano 梯度值

neural-network - 我可以在反向传播过程中(选择性地)反转Theano梯度吗?

machine-learning - 具有烤宽面条精度的神经网络

Python - 更新 GUI,使其始终使用更新后的列表

python - 函数不适用于文件中的空格