运行model-master时发现报错如下:
=================================== ERRORS ====================================
_ ERROR collecting object_detection/models/ssd_mobilenet_v3_feature_extractor_test.py _
ssd_mobilenet_v3_feature_extractor_test.py:20: in
from object_detection.models import ssd_mobilenet_v3_feature_extractor
ssd_mobilenet_v3_feature_extractor.py:20: in
from object_detection.meta_architectures import ssd_meta_arch
…\meta_architectures\ssd_meta_arch.py:145: in
class SSDKerasFeatureExtractor(tf.keras.Model):#tf.keras.Model
E AttributeError: module ‘tensorflow.python.keras’ has no attribute ‘Model’
发现tf.keras下无Model,后发现keras 下的__init__()中只导入了models模块,之后将tf.keras.Model 改成tf.keras.models.Model,程序可以运行,报错消失。
AttributeError: module 'tensorflow.python.keras' has no attribute 'Model' , keras中无Model
最新推荐文章于 2023-12-03 21:33:16 发布