wildtreetech / advanced-comp-2017

💻 Material for a course on applied machine-learning for scientists. Taught at EPFL in spring 2017
23 stars 13 forks source link

No module named 'keras' #12

Open Emix26 opened 7 years ago

Emix26 commented 7 years ago

Hi, Does keras come together with the installation of Anaconda or you're supposed to install it separately ?

betatim commented 7 years ago

You need to install it, either conda install keras and if that doesn't work on your platform try pip install keras. If that doesn't work either we need more details from your system and setup.

Emix26 commented 7 years ago

Ah yes, it works. Thanks ! I installed it with "conda install keras"

VINX89 commented 7 years ago

Hi. After installing keras and running the notebook, I get the following:

Error importing tensorflow. Unless you are using bazel, you should not try to import tensorflow from its source directory; please exit the tensorflow source tree, and relaunch your python interpreter from there.

I tried to uninstall and reinstall protobuf as suggested in some thread, but it didn't fix the issue...

betatim commented 7 years ago

Off the top of my head I don't have a good idea. From the error message it sounds like you installed tensorflow from source?

What operating system do you have and how did you try to install keras and tensorflow?

VINX89 commented 7 years ago

I managed to fix the problem by changing 'tensorflow' with 'theano'. In particular, I set "backend": "theano" in my .keras/keras.json file.

betatim commented 7 years ago

Good to hear it works. There should be no difference between using the theano or tensorflow backend. There are a few edge cases where it could go wrong but these should be mostly in cases where you start using other people's code that contains something fine tuned to their particular backend. In particular tf and theano order the indices differently for images.

More notes: https://keras.io/backend/