Keras.applications not found

7,498 views
Skip to first unread message

Saurav Sharma

unread,
Sep 2, 2016, 10:36:14 AM9/2/16
to Keras-users
Hi,

I have installed keras version 1.0.8 in Ubuntu 14.04, but the below line shows import error. 

from keras.applications.vgg16 import VGG16
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named applications.vgg16


In the dir(keras) it is not showing the applications module, but it is the latest version of the keras. I am confused.
Please help.

Fabien Ric

unread,
Sep 3, 2016, 8:42:57 AM9/3/16
to Keras-users
Hi,

Just had the same issue on Mac OSX using keras 1.0.8 (installed with pip).

It turns out that while the 1.0.8 release version on GitHub doesn't contain the keras.applications sources, they're present in the master branch.

To fix the problem:
  1. Uninstall keras, for example with pip or pip3:
    sudo pip3 uninstall keras

  2. Install the master version
    1. Clone or download the source directly from GitHub: https://github.com/fchollet/keras
    2. Cd into the keras directory
    3. Install by running
       sudo python setup.py install

Hope it'll work for you

Fabien

Fabien Ric

unread,
Sep 3, 2016, 8:54:52 AM9/3/16
to Keras-users
In fact the above answer didn't work to properly use Keras in Jupyter Notebook.
I had to re-install Keras using pip, but this time by specifying the github repository:

sudo pip3 uninstall keras
sudo pip3 install git
+https://github.com/fchollet/keras.git


Now it's working like a charm :)


More information:

Wei You

unread,
Mar 28, 2017, 10:33:57 AM3/28/17
to Keras-users
I have a similar problem on Windows, there is no module name applications, I fixed it by update the keras.

在 2016年9月2日星期五 UTC+8下午10:36:14,Saurav Sharma写道:
Reply all
Reply to author
Forward
0 new messages