成功解决AttributeError: module 'tensorflow.python.keras' has no attribute 'Model'

简介: 成功解决AttributeError: module 'tensorflow.python.keras' has no attribute 'Model'

解决问题


 File "object_detection/builders/model_builder_test.py", line 24, in <module>

   from object_detection.builders import model_builder

 File "F:\File_Python\Python_example\models-master\research\object_detection\builders\model_builder.py", line 22, in <module>

   from object_detection.builders import box_predictor_builder

 File "F:\File_Python\Python_example\models-master\research\object_detection\builders\box_predictor_builder.py", line 21, in <module>

   from object_detection.predictors import convolutional_box_predictor

 File "F:\File_Python\Python_example\models-master\research\object_detection\predictors\convolutional_box_predictor.py", line 19, in <module>

   from object_detection.core import box_predictor

 File "F:\File_Python\Python_example\models-master\research\object_detection\core\box_predictor.py", line 137, in <module>

   class KerasBoxPredictor(tf.keras.Model):

AttributeError: module 'tensorflow.python.keras' has no attribute 'Model'




解决方法


升级tensorflow到最新版本即可!


pip install -U tensorflow

 


相关文章
|
11天前
|
Python
IDA3.12版本的python,依旧报错IDAPython: error executing init.py.No module named ‘impRefer to the message win
IDA3.12版本的python,依旧报错IDAPython: error executing init.py.No module named ‘impRefer to the message win
|
4月前
|
Ubuntu Python
Python(六)使用pycharm创建项目报错:ModuleNotFoundError No module named distutils.util
在ubuntu上使用pycharm创建项目的时候报错: ModuleNotFoundError: No module named 'distutils.util'
612 0
|
1月前
|
文字识别 Python
python代码运行报错:No module named 'aliyunsdkcore'
用python调用阿里云图片OCR识别,使用的是阿里云官方给的传本地图片文件进行检测的代码,运行报错:No module named 'aliyunsdkcore'。在pycharm python软件包和终端里安装aliyunsdkcore这个模块都失败了。
|
4月前
|
Kubernetes Python 微服务
Python3异常-AttributeError: module 'sys' has no attribute 'setdefaultencoding
Python3异常-AttributeError: module 'sys' has no attribute 'setdefaultencoding
46 0
|
5月前
|
Python
python ModuleNotFoundError: No module named ‘ldap‘ Failed building wheel for python-ldap
python ModuleNotFoundError: No module named ‘ldap‘ Failed building wheel for python-ldap
46 0
|
5月前
|
Python
Python报错: No module named 'requests'
Python报错: No module named 'requests'
77 1
|
5月前
|
Python
Python报错: No module named 'lxml'
Python报错: No module named 'lxml'
79 1
|
5月前
|
Python
python 2.6下 No module named sysconfig
python 2.6下 No module named sysconfig
|
8月前
|
数据库 Python
[Python]Django模型(Model)(二)
[Python]Django模型(Model)(二)
|
8月前
|
设计模式 SQL 数据库