问题
So i finally managed to get theano up and running on the GPU using this guide. (the test code runs fine, telling me it used the GPU, YAY!!) I then wanted to try it out and followed this guide for training a CNN on digit recognition.
problem is: i get errors from the way lasagne calls theano (i guess there is a version mismatch here):
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 . . .
From reading about the error message, it seems that 'downsample' was changed, so why is my lasagne still calling it??
trying to update my lasagne version gives:
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)
and running the code sample
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)
reveals that python3.5 uses 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 . . .
Sorry for the long post, but i'm going a little crazy of this not working.. Maybe i am wrong in the version mismatch and the error is something else?
回答1:
Try to reinstall Theano and Lasagne like this:
pip install --upgrade https://github.com/Theano/Theano/archive/master.zip
pip install --upgrade https://github.com/Lasagne/Lasagne/archive/master.zip
Because: "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."
Read more: lasagne.readthedocs.io/en/latest/user/installation.html
来源:https://stackoverflow.com/questions/42998355/lasagne-vs-theano-possible-version-mismatch-windows