Peter Cotton
Peter Cotton

Reputation: 1851

keras import fails "no module named contrib.ctc"

On OSX El CApitan 10.11.6 I've installed theano & tensorflow fine. But the keras install is not happy as seen from the trace below. I've seen this reported on github issues but with no solution there, only a suggestion to post here on SO.

>>>import theano
>>>
>>> import tensorflow
>>> 
>>> import keras
     File "/Users/petercotton/anaconda2/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 6, in <module>
        import tensorflow.contrib.ctc as ctc
    ImportError: No module named contrib.ctc`

Suggestions appreciated.

Upvotes: 2

Views: 2255

Answers (1)

nemo
nemo

Reputation: 57659

This is a problem with Keras, not TensorFlow and a known issue. A workaround is mentioned here but that would mean that you have to modify Keras code (keras/backend/tensorflow_backend.py).

Luckily, it seems that this issue is fixed in the master branch of Keras.

Upvotes: 1

Related Questions