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跟这里一样,就不给图了。