AttributeError: module 'tensorflow.compat.v2' has no attribute '__internal__'

 

File /home/software/anaconda3/envs/mydlenv/lib/python3.8/site-packages/keras/backend_config.py:33
     28 # Default image data format, one of "channels_last", "channels_first".
     29 _IMAGE_DATA_FORMAT = "channels_last"
     32 @keras_export("keras.backend.epsilon")
---> 33 @tf.__internal__.dispatch.add_dispatch_support
     34 def epsilon():

 

 

 

tensorflow和keras版本不对应问题

 

卸载tensorflow和keras

安装指定版本tensorflow和keras

Installing collected packages: tensorflow
Successfully installed tensorflow-2.2.0

Successfully installed keras-2.2.0 keras-applications-1.0.2 keras-preprocessing-1.0.1 pyyaml-6.0

 

ImportError: cannot import name 'Input' from 'keras.engine' (/home/software/anaconda3/envs/mydlenv/lib/python3.8/site-packages/keras/engine/__init__.py)

 

posted @ 2023-10-09 22:34  emanlee  阅读(682)  评论(0编辑  收藏  举报