我正在开发Python上的Tensorflow对象检测API。我正在训练一个自定义的对象检测算法,使用的预训练模型是ssd_mobilenet_v1_pets.config,当我试图从模型/对象_检测的遗留文件夹运行train.py时,我得到了这个特定的错误
Traceback (most recent call last):
File "train.py", line 48, in <module>
from object_detection.builders import model_builder
File "C:\Users\Captain\AppData\Local\Programs\Python\Python36\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\builders\model_builder.py", line 47, in <module>
from object_detection.models.ssd_mobilenet_edgetpu_feature_extractor import SSDMobileNetEdgeTPUFeatureExtractor
File "C:\Users\Captain\AppData\Local\Programs\Python\Python36\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\models\ssd_mobilenet_edgetpu_feature_extractor.py", line 19, in <module>
from object_detection.models import ssd_mobilenet_v3_feature_extractor
File "C:\Users\Captain\AppData\Local\Programs\Python\Python36\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\models\ssd_mobilenet_v3_feature_extractor.py", line 25, in <module>
from nets.mobilenet import mobilenet
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 656, in _load_unlocked
File "<frozen importlib._bootstrap>", line 626, in _load_backward_compatible
File "C:\Users\Captain\AppData\Local\Programs\Python\Python36\lib\site-packages\slim-0.1-py3.6.egg\nets\mobilenet\mobilenet.py", line 399, in <module>
AttributeError: module 'tensorflow._api.v1.compat' has no attribute 'v2'
我有过
这是我试图在windows命令提示符上运行的命令。
python train.py --logtostderr --train_dir=Users/Captain/Desktop/ANPR V1/ --pipeline_config_path=Users/Captain/Desktop/ANPR V1/ssd_inception_v2_coco.config
我想可能是因为我使用了另一个模型,所以也尝试了下面的命令
python train.py --logtostderr --train_dir=Users/Captain/Desktop/ANPR V1/ --pipeline_config_path=Users/Captain/Desktop/ANPR V1/ssd_mobilenet_v1_pets.config
但我也犯了同样的错误
发布于 2020-02-19 04:07:56
我也面临着同样的问题。如果您下载了tensorflow模型的最新存储库,那么尝试下载这个1.13.0版的tensorflow模型而不是使用Tensorflow 1.13.2的最新回购。它解决了我的问题。。
https://stackoverflow.com/questions/60292905
复制