keras_contrib

Hello! I can not find a solution to this problem: 

from keras_contrib.layers import InstanceNormalization
ModuleNotFoundError: No module named 'keras_contrib'

I tried to perform:

!pip install keras_contrib

Got a response:

Requirement already satisfied: keras_contrib in /usr/local/lib/python3.6/dist-packages/keras_contrib-2.0.8-py3.6.egg (2.0.8)
Requirement already satisfied: keras in /usr/local/lib/python3.6/dist-packages (from keras_contrib) (2.2.4)
Requirement already satisfied: keras-preprocessing>=1.0.5 in /usr/local/lib/python3.6/dist-packages (from keras->keras_contrib) (1.0.9)
Requirement already satisfied: h5py in /usr/local/lib/python3.6/dist-packages (from keras->keras_contrib) (2.8.0)
Requirement already satisfied: scipy>=0.14 in /usr/local/lib/python3.6/dist-packages (from keras->keras_contrib) (1.1.0)
Requirement already satisfied: pyyaml in /usr/local/lib/python3.6/dist-packages (from keras->keras_contrib) (3.13)
Requirement already satisfied: keras-applications>=1.0.6 in /usr/local/lib/python3.6/dist-packages (from keras->keras_contrib) (1.0.7)
Requirement already satisfied: six>=1.9.0 in /usr/local/lib/python3.6/dist-packages (from keras->keras_contrib) (1.11.0)
Requirement already satisfied: numpy>=1.9.1 in /usr/local/lib/python3.6/dist-packages (from keras->keras_contrib) (1.14.6)  

 Tell me where to find a solution?

i use google colab

Googling for “importerror keras-contrib” shows a lot of questions where people have failed to install properly.

When you execute the command “conda list” (assuming you are using conda), is keras-contrib in the list? If not, you’ve failed to install it properly for conda.

The recommended command, as per the Keras installation page is:

sudo pip install git+https://www.github.com/keras-team/keras-contrib.git
3 Likes

Thanks! this worked