keras-team / keras

Deep Learning for humans
http://keras.io/
Apache License 2.0
61.63k stars 19.42k forks source link

'module' object has no attribute 'signal' #487

Closed gnuchoi closed 9 years ago

gnuchoi commented 9 years ago

Now I'm working on two machines; one iMac and the other on linux server.

iMac: MacOsX, python 2.7.6. theano 0.7.0, keras installed with sudo pip. server: python 2.7.10 Anaconda, theano 0.6.0, keras was cloned with local folder with sys.path.append(''), then I tested after install it by python setup.py install --user.

Symptoms: keras throws an error for my code, cifar10_cnn and mnist_cnn examples while all of them works well on my iMac.

---before re-install---

File "/home1/irteam/users/keunwoo/learning_audio.py", line 55, in buildConvNetModel model.compile(loss='categorical_crossentropy', optimizer=sgd) File "build/bdist.linux-x86_64/egg/keras/models.py", line 287, in compile File "build/bdist.linux-x86_64/egg/keras/layers/containers.py", line 51, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 223, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 356, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 198, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 356, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 198, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 356, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 277, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 198, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/convolutional.py", line 167, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 198, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/convolutional.py", line 210, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/convolutional.py", line 167, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 198, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/convolutional.py", line 210, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/convolutional.py", line 167, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/convolutional.py", line 211, in get_output TypeError: max_pool_2d() got an unexpected keyword argument 'st'

---now--- File "mnist_cnn.py", line 59, in model.compile(loss='categorical_crossentropy', optimizer='adadelta') File "build/bdist.linux-x86_64/egg/keras/models.py", line 351, in compile File "build/bdist.linux-x86_64/egg/keras/layers/containers.py", line 53, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 257, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 392, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 232, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 257, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 392, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 313, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 232, in get_output File "build/bdist.linux-x86_64/egg/keras/layers/core.py", line 31, in get_input File "build/bdist.linux-x86_64/egg/keras/layers/convolutional.py", line 210, in get_output AttributeError: 'module' object has no attribute 'signal'

The messages are the same for all three codes. It could be problem on the way I installed keras, theano version, or even python version, or something else that I can't imagine. Sadly I'm not allowed to use sudo on the server, now I'm going to try on virtualenv. I'd appreciate any comments!

fchollet commented 9 years ago

Upgrade Theano to its latest version.

mermolenko commented 9 years ago

I had the same issue with Theano 0.7 version. I added: import theano.tensor.signal.conv from theano.tensor.signal import downsample to convolutional.py and it solved the problem.

gnuchoi commented 9 years ago

@michael-ermolenko It solved my problem, thanks.

zeynepsu commented 9 years ago

I had the same two problems after I installed keras by cloning. sudo pip install keras --upgrade solves the "TypeError: max_pool_2d() got an unexpected keyword argument 'st'" problem and @michael-ermolenko 's answer solves the "AttributeError: 'module' object has no attribute 'signal'" problem. Maybe making a PR with this solution would help?

pkainz commented 9 years ago

+1 for PR with @michael-ermolenko 's solution

asampat3090 commented 9 years ago

+2 for PR with @michael-ermolenko's solution - worked like a charm.

wtlim commented 8 years ago

@michael-ermolenko <-- your solution solved the problem. :)