bert icon indicating copy to clipboard operation
bert copied to clipboard

Import error with extract_features.py

Open mfxss opened this issue 8 years ago • 1 comments

My tensorflow is 1.12.

Traceback (most recent call last):
  File "extract_features.py", line 26, in <module>
    import modeling
  File "/home/mengyuguang/bert-master/modeling.py", line 27, in <module>
    import tensorflow as tf
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 88, in <module>
    from tensorflow.python import keras
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/__init__.py", line 24, in <module>
    from tensorflow.python.keras import activations
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/activations/__init__.py", line 22, in <module>
    from tensorflow.python.keras._impl.keras.activations import elu
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/_impl/keras/__init__.py", line 21, in <module>
    from tensorflow.python.keras._impl.keras import activations
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/_impl/keras/activations.py", line 23, in <module>
    from tensorflow.python.keras._impl.keras import backend as K
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/_impl/keras/backend.py", line 38, in <module>
    from tensorflow.python.layers import base as tf_base_layers
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/layers/base.py", line 25, in <module>
    from tensorflow.python.keras.engine import base_layer
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/engine/__init__.py", line 23, in <module>
    from tensorflow.python.keras.engine.base_layer import InputSpec
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/engine/base_layer.py", line 35, in <module>
    from tensorflow.python.keras import backend
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/keras/backend/__init__.py", line 22, in <module>
    from tensorflow.python.keras._impl.keras.backend import abs
ImportError: cannot import name abs

mfxss avatar Nov 08 '18 08:11 mfxss

This has something to do with your TF environment, you'll need to ask for help on a general TF forum.

jacobdevlin-google avatar Nov 08 '18 18:11 jacobdevlin-google