I am trying to use the BERT in Keras with keras_bert and tensorflow, the complete code is here, but I am getting this error:
The error is on this line:
from tensorflow.python.util.tf_export import keras_export
The error is:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-18-eea03a4a6625> in <module>
----> 1 from tensorflow.python.util.tf_export import keras_export
ImportError: cannot import name 'keras_export' from 'tensorflow.python.util.tf_export' (C:\Users\DILAW\Anaconda3\lib\site-packages\tensorflow\python\util\tf_export.py)
Tensorflow is not uninstalled when tensorflow-gpu is install. That is the problem in importing the keras_import. So if we uninstall the tensorflow then the problem is solved.
tensorflow_version 2.x
!pip uninstall -y tensorflow
!pip install tensorflow-gpu==1.14.0
Hope it works!!
the last tensorflow update have change alot of thinks, also the BERT model have a new method to use it please chek here for more information link.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With