transfer_learning_sipeed icon indicating copy to clipboard operation
transfer_learning_sipeed copied to clipboard

AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'

Open cyprian opened this issue 5 years ago • 0 comments

Hi, thank you for the great tutorial. Upon running the test.py it fails with the AttributeError. I am new to python, so this might be a simple thing to fix?

Using TensorFlow backend.
/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint8 = np.dtype([("qint8", np.int8, 1)])
/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint16 = np.dtype([("qint16", np.int16, 1)])
/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  _np_qint32 = np.dtype([("qint32", np.int32, 1)])
/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
  np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import keras
  File "/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/keras/__init__.py", line 3, in <module>
    from . import utils
  File "/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/keras/utils/__init__.py", line 6, in <module>
    from . import conv_utils
  File "/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 9, in <module>
    from .. import backend as K
  File "/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/keras/backend/__init__.py", line 1, in <module>
    from .load_backend import epsilon
  File "/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/keras/backend/load_backend.py", line 90, in <module>
    from .tensorflow_backend import *
  File "/Users/cv/opt/miniconda3/envs/ml/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 54, in <module>
    get_graph = tf_keras_backend.get_graph
AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'

cyprian avatar Apr 13 '20 09:04 cyprian