Keras Import Error Tensorflow backend -
--------------------------------------------------------------------------- importerror traceback (most recent call last) /users/cjl/anaconda3/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in <module>() 4 try: ----> 5 tensorflow.python.ops import ctc_ops ctc 6 except importerror: importerror: cannot import name 'ctc_ops' during handling of above exception, exception occurred: importerror traceback (most recent call last) <ipython-input-10-c74e2bd4ca71> in <module>() ----> 1 import keras /users/cjl/anaconda3/lib/python3.5/site-packages/keras/__init__.py in <module>() 1 __future__ import absolute_import ----> 2 . import backend 3 . import datasets 4 . import engine 5 . import layers /users/cjl/anaconda3/lib/python3.5/site-packages/keras/backend/__init__.py in <module>() 67 elif _backend == 'tensorflow': 68 sys.stderr.write('using tensorflow backend.\n') ---> 69 .tensorflow_backend import * 70 else: 71 raise exception('unknown backend: ' + str(_backend)) /users/cjl/anaconda3/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py in <module>() 5 tensorflow.python.ops import ctc_ops ctc 6 except importerror: ----> 7 import tensorflow.contrib.ctc ctc 8 9 import numpy np importerror: no module named 'tensorflow.contrib.ctc' seems problem keras , not tensorflow according post enter link description here wondering if has been fixed yet?
this problem between keras , tensorflow. should change fix use like
if hasattr(tf.contrib, 'ctc'): ctc = tf.contrib.ctc # old version else: ctc = tf.nn # new official version. the current "official" way access ctc operations in tf.nn, instance, tf.nn.ctc_loss.
Comments
Post a Comment