Error while using ssd_mobilenet_v2_coco as finetune checkpoint
System information
- What is the top-level directory of the model you are using: Face detection
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): No
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 17.10
- TensorFlow installed from (source or binary): pip
- TensorFlow version (use command below): 1.6, 1.7
- Bazel version (if compiling from source): No
- CUDA/cuDNN version: CUDA 9.0, cuDNN 7.0.5
- GPU model and memory: GeForce GTX 1060, 6GB
- Exact command to reproduce:
python tflib/object_detection/train.py --logtostderr \
--pipeline_config_path=temp/checkpoints/ssd_mobilenet_v2_coco_2018_03_29/pipeline.config \
--train_dir=temp/models/ssd_mobilenet_t01/train
Describe the problem
I setup my system as noted here:
https://github.com/ndaidong/tf-object-detection
In the same way, it worked as well with faster_rcnn_inception_v2_coco and faster_rcnn_resnet101_coco. But now when I try to train from ssd_mobilenet_v2_coco, it doesn't work.
For the pipeline config, I firstly used the one which included within ssd_mobilenet_v2_coco_2018_03_29.tar.gz:

Then I tried with this sample. Both don't work.
My modified version:
https://github.com/ndaidong/tf-object-detection/blob/master/configs/face-detection/ssd_mobilenet_v2_coco.config
The script stopped immediately after starting training. At first, it said as Log 1 below. Then I commented the line fine_tune_checkpoint_type and it thrown Log 2.
How I can get it work?
Thanks.
Source code / logs
Log 1:
File "tflib/object_detection/train.py", line 169, in <module>
tf.app.run()
File "/home/dongnd/cv-env/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "tflib/object_detection/train.py", line 92, in main
FLAGS.pipeline_config_path)
File "/home/dongnd/tf-object-detection/tflib/object_detection/utils/config_util.py", line 88, in get_configs_from_pipeline_file
text_format.Merge(proto_str, pipeline_config)
File "/home/dongnd/cv-env/lib/python3.6/site-packages/google/protobuf/text_format.py", line 533, in Merge
descriptor_pool=descriptor_pool)
File "/home/dongnd/cv-env/lib/python3.6/site-packages/google/protobuf/text_format.py", line 587, in MergeLines
return parser.MergeLines(lines, message)
File "/home/dongnd/cv-env/lib/python3.6/site-packages/google/protobuf/text_format.py", line 620, in MergeLines
self._ParseOrMerge(lines, message)
File "/home/dongnd/cv-env/lib/python3.6/site-packages/google/protobuf/text_format.py", line 635, in _ParseOrMerge
self._MergeField(tokenizer, message)
File "/home/dongnd/cv-env/lib/python3.6/site-packages/google/protobuf/text_format.py", line 735, in _MergeField
merger(tokenizer, message, field)
File "/home/dongnd/cv-env/lib/python3.6/site-packages/google/protobuf/text_format.py", line 823, in _MergeMessageField
self._MergeField(tokenizer, sub_message)
File "/home/dongnd/cv-env/lib/python3.6/site-packages/google/protobuf/text_format.py", line 703, in _MergeField
(message_descriptor.full_name, name))
google.protobuf.text_format.ParseError: 161:3 : Message type "object_detection.protos.TrainConfig" has no field named "fine_tune_checkpoint_type".
Log 2:
Traceback (most recent call last):
File "tflib/object_detection/train.py", line 169, in <module>
tf.app.run()
File "/home/dongnd/cv-env/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "tflib/object_detection/train.py", line 165, in main
worker_job_name, is_chief, FLAGS.train_dir)
File "/home/dongnd/tf-object-detection/tflib/object_detection/trainer.py", line 211, in train
detection_model = create_model_fn()
File "/home/dongnd/tf-object-detection/tflib/object_detection/builders/model_builder.py", line 88, in build
return _build_ssd_model(model_config.ssd, is_training, add_summaries)
File "/home/dongnd/tf-object-detection/tflib/object_detection/builders/model_builder.py", line 149, in _build_ssd_model
is_training)
File "/home/dongnd/tf-object-detection/tflib/object_detection/builders/model_builder.py", line 121, in _build_ssd_feature_extractor
raise ValueError('Unknown ssd feature_extractor: {}'.format(feature_type))
ValueError: Unknown ssd feature_extractor: ssd_mobilenet_v2
The error log indicating that the proto object TrainConfig does not contain field fine_tune_checkpoint_type, which was added by #3656. I guess you have a old version of code running on local. Can you check that and make sure the code is up to date?
@qlzh727 thank you. I just started this study several days ago, all related resources are newest. However, let's I check it again.
@qlzh727 you may be correct. There is a few changes since last update. Now it leads to new issue (still works well with Faster R-CNN):
Instructions for updating:
Please switch to tf.train.create_global_step
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
INFO:tensorflow:depth of additional conv before box predictor: 0
WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/beta] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/beta/ExponentialMovingAverage] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/beta/RMSProp] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/beta/RMSProp_1] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/gamma] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/gamma/ExponentialMovingAverage] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/gamma/RMSProp] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Conv2d_1a_7x7/BatchNorm/gamma/RMSProp_1] is not available in checkpoint
.................
TOO LOONG, REMOVED
.................
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/weights] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/weights/ExponentialMovingAverage] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/weights/RMSProp] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/weights/RMSProp_1] is not available in checkpoint
Traceback (most recent call last):
File "tflib/object_detection/train.py", line 167, in <module>
tf.app.run()
File "/home/dongnd/cv-env/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 126, in run
_sys.exit(main(argv))
File "tflib/object_detection/train.py", line 163, in main
worker_job_name, is_chief, FLAGS.train_dir)
File "/home/dongnd/tf-object-detection/tflib/object_detection/trainer.py", line 381, in train
init_saver = tf.train.Saver(available_var_map)
File "/home/dongnd/cv-env/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1293, in __init__
self.build()
File "/home/dongnd/cv-env/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1302, in build
self._build(self._filename, build_save=True, build_restore=True)
File "/home/dongnd/cv-env/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1327, in _build
raise ValueError("No variables to save")
ValueError: No variables to save
@ndaidong It seems that you're using mobilenetv2's checkpoint to fine tune inceptionv2's network... Which does not make any sense, since both network have different structure.
@ndaidong I have the same problem with you, how do you solve it.
@ferris1 not yet. It still does not work. @lcycoding I don't know why it mentioned inception in the log. I've downloaded exactly ssd_mobilenet_v2_coco_2018_03_29.tar.gz and used its own pipeline config (as my first post).
Reassign the issue to the owner @tombstone
Thank you TensorFlow team and the contributors. I would like to confirm that this issue no longer occur for me. With the last updates today and the completely new ssd_mobilenet_v2_coco.config, the training phase works as well. If there is no more problem I will close this issue after training done.
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_4_3x3_s2_256/BatchNorm/gamma] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_4_3x3_s2_256/BatchNorm/gamma/ExponentialMovingAverage] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_4_3x3_s2_256/BatchNorm/gamma/RMSProp] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_4_3x3_s2_256/BatchNorm/gamma/RMSProp_1] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_4_3x3_s2_256/BatchNorm/moving_mean] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_4_3x3_s2_256/BatchNorm/moving_variance] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_4_3x3_s2_256/weights] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_4_3x3_s2_256/weights/ExponentialMovingAverage] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_4_3x3_s2_256/weights/RMSProp] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_4_3x3_s2_256/weights/RMSProp_1] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/BatchNorm/beta] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/BatchNorm/beta/ExponentialMovingAverage] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/BatchNorm/beta/RMSProp] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/BatchNorm/beta/RMSProp_1] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/BatchNorm/gamma] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/BatchNorm/gamma/ExponentialMovingAverage] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/BatchNorm/gamma/RMSProp] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/BatchNorm/gamma/RMSProp_1] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/BatchNorm/moving_mean] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/BatchNorm/moving_variance] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/weights] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/weights/ExponentialMovingAverage] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/weights/RMSProp] is not available in checkpoint
WARNING:root:Variable [FeatureExtractor/InceptionV2/Mixed_5c_2_Conv2d_5_3x3_s2_128/weights/RMSProp_1] is not available in checkpoint
Traceback (most recent call last):
File "train.py", line 185, in
I m having this issue in ssd-mobilenet-v2-coco.config . Any solutions?
ValueError: ssd_mobilenet_v1 is not supported. See model_builder.py for features extractors compatible with different versions of Tensorflow
Any suggestions
ValueError: ssd_mobilenet_v1 is not supported. See
model_builder.pyfor features extractors compatible with different versions of TensorflowAny suggestions
@p135 have u got the solution of ur problem....I have the same issue pls help
ValueError: ssd_mobilenet_v1 is not supported. See
model_builder.pyfor features extractors compatible with different versions of TensorflowAny suggestions
Hi I am also facing the same issue!
ValueError: ssd_mobilenet_v2 is not supported. See model_builder.py for features extractors compatible with different versions of Tensorflow
you found any solution? Thanks, Sundar.
ValueError: ssd_mobilenet_v1 is not supported. See
model_builder.pyfor features extractors compatible with different versions of Tensorflow Any suggestionsHi I am also facing the same issue! ValueError: ssd_mobilenet_v2 is not supported. See
model_builder.pyfor features extractors compatible with different versions of Tensorflowyou found any solution? Thanks, Sundar.
CHECK THE BELOW CODE FOR WHICH VERSION UR MODEL IS COMPATIBLE HENCE USE ACCORDINGLY...
if tf_version.is_tf2(): #FOR TENSORFLOW VERSION 2 SSD_KERAS_FEATURE_EXTRACTOR_CLASS_MAP = { 'ssd_mobilenet_v1_keras': SSDMobileNetV1KerasFeatureExtractor, 'ssd_mobilenet_v1_fpn_keras': SSDMobileNetV1FpnKerasFeatureExtractor, 'ssd_mobilenet_v2_keras': SSDMobileNetV2KerasFeatureExtractor, 'ssd_mobilenet_v2_fpn_keras': SSDMobileNetV2FpnKerasFeatureExtractor, 'ssd_resnet50_v1_fpn_keras': ssd_resnet_v1_fpn_keras.SSDResNet50V1FpnKerasFeatureExtractor, 'ssd_resnet101_v1_fpn_keras': ssd_resnet_v1_fpn_keras.SSDResNet101V1FpnKerasFeatureExtractor, 'ssd_resnet152_v1_fpn_keras': ssd_resnet_v1_fpn_keras.SSDResNet152V1FpnKerasFeatureExtractor, }
FASTER_RCNN_KERAS_FEATURE_EXTRACTOR_CLASS_MAP = { 'faster_rcnn_resnet50_keras': frcnn_resnet_keras.FasterRCNNResnet50KerasFeatureExtractor, 'faster_rcnn_resnet101_keras': frcnn_resnet_keras.FasterRCNNResnet101KerasFeatureExtractor, 'faster_rcnn_resnet152_keras': frcnn_resnet_keras.FasterRCNNResnet152KerasFeatureExtractor, 'faster_rcnn_inception_resnet_v2_keras': frcnn_inc_res_keras.FasterRCNNInceptionResnetV2KerasFeatureExtractor, }
CENTER_NET_EXTRACTOR_FUNCTION_MAP = { 'resnet_v2_50': center_net_resnet_feature_extractor.resnet_v2_50, 'resnet_v2_101': center_net_resnet_feature_extractor.resnet_v2_101, 'resnet_v1_50_fpn': center_net_resnet_v1_fpn_feature_extractor.resnet_v1_50_fpn, 'resnet_v1_101_fpn': center_net_resnet_v1_fpn_feature_extractor.resnet_v1_101_fpn, 'hourglass_104': center_net_hourglass_feature_extractor.hourglass_104, }
FEATURE_EXTRACTOR_MAPS = [ CENTER_NET_EXTRACTOR_FUNCTION_MAP, FASTER_RCNN_KERAS_FEATURE_EXTRACTOR_CLASS_MAP, SSD_KERAS_FEATURE_EXTRACTOR_CLASS_MAP }
if tf_version.is_tf1(): #FOR TENSORFLOW VERSION 1 SSD_FEATURE_EXTRACTOR_CLASS_MAP = { 'ssd_inception_v2': SSDInceptionV2FeatureExtractor, 'ssd_inception_v3': SSDInceptionV3FeatureExtractor, 'ssd_mobilenet_v1': SSDMobileNetV1FeatureExtractor, 'ssd_mobilenet_v1_fpn': SSDMobileNetV1FpnFeatureExtractor, 'ssd_mobilenet_v1_ppn': SSDMobileNetV1PpnFeatureExtractor, 'ssd_mobilenet_v2': SSDMobileNetV2FeatureExtractor, 'ssd_mobilenet_v2_fpn': SSDMobileNetV2FpnFeatureExtractor, 'ssd_mobilenet_v2_mnasfpn': SSDMobileNetV2MnasFPNFeatureExtractor, 'ssd_mobilenet_v3_large': SSDMobileNetV3LargeFeatureExtractor, 'ssd_mobilenet_v3_small': SSDMobileNetV3SmallFeatureExtractor, 'ssd_mobilenet_edgetpu': SSDMobileNetEdgeTPUFeatureExtractor, 'ssd_resnet50_v1_fpn': ssd_resnet_v1_fpn.SSDResnet50V1FpnFeatureExtractor, 'ssd_resnet101_v1_fpn': ssd_resnet_v1_fpn.SSDResnet101V1FpnFeatureExtractor, 'ssd_resnet152_v1_fpn': ssd_resnet_v1_fpn.SSDResnet152V1FpnFeatureExtractor, 'ssd_resnet50_v1_ppn': ssd_resnet_v1_ppn.SSDResnet50V1PpnFeatureExtractor, 'ssd_resnet101_v1_ppn': ssd_resnet_v1_ppn.SSDResnet101V1PpnFeatureExtractor, 'ssd_resnet152_v1_ppn': ssd_resnet_v1_ppn.SSDResnet152V1PpnFeatureExtractor, 'embedded_ssd_mobilenet_v1': EmbeddedSSDMobileNetV1FeatureExtractor, 'ssd_pnasnet': SSDPNASNetFeatureExtractor, 'ssd_mobiledet_cpu': SSDMobileDetCPUFeatureExtractor, 'ssd_mobiledet_dsp': SSDMobileDetDSPFeatureExtractor, 'ssd_mobiledet_edgetpu': SSDMobileDetEdgeTPUFeatureExtractor, 'ssd_mobiledet_gpu': SSDMobileDetGPUFeatureExtractor, }
FASTER_RCNN_FEATURE_EXTRACTOR_CLASS_MAP = { 'faster_rcnn_nas': frcnn_nas.FasterRCNNNASFeatureExtractor, 'faster_rcnn_pnas': frcnn_pnas.FasterRCNNPNASFeatureExtractor, 'faster_rcnn_inception_resnet_v2': frcnn_inc_res.FasterRCNNInceptionResnetV2FeatureExtractor, 'faster_rcnn_inception_v2': frcnn_inc_v2.FasterRCNNInceptionV2FeatureExtractor, 'faster_rcnn_resnet50': frcnn_resnet_v1.FasterRCNNResnet50FeatureExtractor, 'faster_rcnn_resnet101': frcnn_resnet_v1.FasterRCNNResnet101FeatureExtractor, 'faster_rcnn_resnet152': frcnn_resnet_v1.FasterRCNNResnet152FeatureExtractor, }
U can use TensorFlow==1.15 as almost all models are compatible with this 1.X version of TensorFlow
ValueError: ssd_mobilenet_v1 is not supported. See
model_builder.pyfor features extractors compatible with different versions of Tensorflow Any suggestions@p135 have u got the solution of ur problem....I have the same issue pls help
Have anyone solved this....getting the same error
ValueError: ssd_mobilenet_v1 is not supported. See
model_builder.pyfor features extractors compatible with different versions of Tensorflow Any suggestions@p135 have u got the solution of ur problem....I have the same issue pls help
Have anyone solved this....getting the same error
check the above solution...
ValueError: ssd_mobilenet_v1 is not supported. See
model_builder.pyfor features extractors compatible with different versions of Tensorflow Any suggestions@p135 have u got the solution of ur problem....I have the same issue pls help
Have anyone solved this....getting the same error
check the above solution...
Should I copy paste the above code in model_builder.py for tf1
ValueError: ssd_mobilenet_v1 is not supported. See
model_builder.pyfor features extractors compatible with different versions of Tensorflow Any suggestions@p135 have u got the solution of ur problem....I have the same issue pls help
Have anyone solved this....getting the same error
check the above solution...
Should I copy paste the above code in model_builder.py for tf1
No, the above code is to check which model is compatible to which version of tf....just check and use that particular model or change ur tf version.
@Datapirate-98
Hey, I solved that issue. This is a seperate one, I am working on object detection. I trained till 5000 epochs and different ckpt files are created now. Can I store this folder on google drive and use it again whenever. Will the training start from the same point.
@Datapirate-98
Hey, I solved that issue. This is a seperate one, I am working on object detection. I trained till 5000 epochs and different ckpt files are created now. Can I store this folder on google drive and use it again whenever. Will the training start from the same point.
Yes u can...
@Datapirate-98 Hey, I solved that issue. This is a seperate one, I am working on object detection. I trained till 5000 epochs and different ckpt files are created now. Can I store this folder on google drive and use it again whenever. Will the training start from the same point.
Yes u can...
Also, I am not creating inference graphs, just saving training folder with ckpt files and using them for training. Can you confirm this?