运行export_interence_graph .py会抛出值错误



我是新来的StackOverflow。我试图通过使用export_inference_graph.py导出一个模型。我使用faster_rcnn_inception_v2局部训练我的模型。我遵循这个教程。

在命令提示符中输入

python export_inference_graph.py --input_type image_tensor --pipeline_config_path CAPTCHA_training/faster_rcnn_inception_v2_coco.config --trained_checkpoint_prefix "CAPTCHA_training_dir/model.ckpt-51272" --output_directory CAPTCHA_inference_graph 

所有正确的路径我得到以下错误。

File "export_inference_graph.py", line 206, in <module>
tf.app.run()
File "C:UsersJatinanaconda3libsite-packagestensorflowpythonplatformapp.py", line 40, in run
_run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
File "C:UsersJatinanaconda3libsite-packagesabslapp.py", line 303, in run
_run_main(main, args)
File "C:UsersJatinanaconda3libsite-packagesabslapp.py", line 251, in _run_main
sys.exit(main(argv))
File "export_inference_graph.py", line 194, in main
exporter.export_inference_graph(
File "C:UsersJatinanaconda3libsite-packagesobject_detectionexporter.py", line 604, in export_inference_graph
detection_model = model_builder.build(pipeline_config.model,
File "C:UsersJatinanaconda3libsite-packagesobject_detectionbuildersmodel_builder.py", line 1116, in build
return build_func(getattr(model_config, meta_architecture), is_training,
File "C:UsersJatinanaconda3libsite-packagesobject_detectionbuildersmodel_builder.py", line 583, in _build_faster_rcnn_model
_check_feature_extractor_exists(frcnn_config.feature_extractor.type)
File "C:UsersJatinanaconda3libsite-packagesobject_detectionbuildersmodel_builder.py", line 249, in _check_feature_extractor_exists
raise ValueError('{} is not supported. See `model_builder.py` for features '
ValueError: faster_rcnn_inception_v2 is not supported. See `model_builder.py` for features extractors compatible with different versions of Tensorflow

我使用Python 3.8.5和tensorflow 2.4.1版本提前感谢

根据错误看起来像是Tensorflow版本问题。查找源faster_rcnn_inception_v2存在于if tf_version.is_tf1():下。

https://github.com/tensorflow/models/blob/5a89897396aa8ecc7b3ef8919f987e96fc8d74db/research/object_detection/builders/model_builder.py L70

https://github.com/tensorflow/models/blob/5a89897396aa8ecc7b3ef8919f987e96fc8d74db/research/object_detection/models/faster_rcnn_inception_resnet_v2_feature_extractor.py L33

faster_rcnn_inception_v2_coco存在于Tensorflow 1检测模型动物园中。

https://github.com/tensorflow/models/blob/5a89897396aa8ecc7b3ef8919f987e96fc8d74db/research/object_detection/g3doc/tf1_detection_zoo.md coco-trained-models

相关内容

  • 没有找到相关文章

最新更新