Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
604 views
in Technique[技术] by (71.8m points)

python - Tensorflow Objct detection API error: ValueError: ssd_mobilenet_v2 is not supported

I am using the TF Object detection API. I am using TF2.4.1, python 3.6, and want to train the mobilenet_v2

I downloaded the official SSD MobileNet v2 320x320 here When running the training from

/tensorflow/model/research/object_detection/model_main_tf2.py

I get the follownig error:

... File "/home/base/anaconda3/envs/AIOD/lib/python3.6/site-packages/object_detection/builders/model_builder.py", line 251, in _check_feature_extractor_exists 'Tensorflow'.format(feature_extractor_type))

ValueError: ssd_mobilenet_v2 is not supported. See model_builder.py for features extractors compatible with different versions of Tensorflow

in my pipeline.config file the fteature extractor is unchanged as:

feature_extractor {
  type: 'ssd_mobilenet_v2'
...
      }

in the ... /model_builder.py I find that the SSD_FEATURE_EXTRACTOR_CLASS_MAP, which is checked in this case, includes the ssd_mobilenet_v2 (Line 185 in model_builder).

Before, I had a problem, that the pipeline.config file could not be found even so I gave the exact location. Copying the pipeline.config file to the tensorflow/models/own_model_Dir made that error dissapear. So maybe, I have to put the model I downloaded into a specfic folder?

Questions


Does anyone know how to solve this?

Do you know where I have to place the model? Do I also have to place it into the tensorflow/models dir?

question from:https://stackoverflow.com/questions/65938445/tensorflow-objct-detection-api-error-valueerror-ssd-mobilenet-v2-is-not-suppor

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The solution is that SSD_FEATURE_EXTRACTOR_CLASS_MAP is under if tf_version.is_tf1(): as I run with TF2.4.1 I am not tf1.

To avoid this either use TF<2 (even though it says in the name model_main_tf2.py) or

you chose as feature extractor in your pipeline.config e.g., ssd_mobilenet_v2_keras. I still have to figure out which is fitting, but that would be a soultion as this extractor is in SSD_KERAS_FEATURE_EXTRACTOR_CLASS_MAP which is under if tf_version.is_tf2():

... Of ourse I ran into toher problems, but that is not for this thread.

EDIT: Another solution is to download and use the correct modelfile. SOmehow I managed to download a TF2 model but used a previously downloaded TF1 file :-S. All of the above is still correct.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...