当前位置: 代码迷 >> 综合 >> tensorflow/models-v1.12.0中使用ssd_mobiledet_cpu_coco
  详细解决方案

tensorflow/models-v1.12.0中使用ssd_mobiledet_cpu_coco

热度:67   发布时间:2023-10-26 00:19:59.0

 

0.环境

ubuntu16.04
python3.6
cuda9.0
cudnn7.6.1
tensorflow-gpu==1.12.0
models==1.12.0

 1.下载

1.1 ssd_mobiledet_cpu_coco预训练模型

https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md

并解压复制到远程服务器ssdlitepretrain_logs上

1.2 下载models-master、修改自己config项目配置

与https://blog.csdn.net/qq_35975447/article/details/108294479同,修改我们自己的配置

2.集成

Step1:复制下面两个文件到指定目录下:

Step2:参考models-master修改/research/object_detection/builders/model_builder.py

添加以下模型导入

from object_detection.models.ssd_mobiledet_feature_extractor import SSDMobileDetCPUFeatureExtractor
from object_detection.models.ssd_mobiledet_feature_extractor import SSDMobileDetDSPFeatureExtractor
from object_detection.models.ssd_mobiledet_feature_extractor import SSDMobileDetEdgeTPUFeatureExtractor

SSD_FEATURE_EXTRACTOR_CLASS_MAP = {'ssd_mobiledet_cpu': SSDMobileDetCPUFeatureExtractor,'ssd_mobiledet_dsp': SSDMobileDetDSPFeatureExtractor,'ssd_mobiledet_edgetpu': SSDMobileDetEdgeTPUFeatureExtractor,}

到models-v1.12.0

Step3:/opt/SSD_Mobilenetv2/models-1.12.0/research/object_detection/models/ssd_mobilenet_v1_feature_extractor.py

修改

为:

 

Step4:修改:ssdlite_mobiledet_cpu_320x320_coco_sync_4x4_gmt.config

  sync_replicas: true
为:sync_replicas: false

Step5:修改预训练模型名称

为:

3.训练正常

https://blog.csdn.net/qq_35975447/article/details/108294479跟这里一样,就不给图了。

4.推理正常

https://blog.csdn.net/qq_35975447/article/details/108294479跟这里一样,就不给图了。

 

  相关解决方案