【问题标题】:Running export_inference_graph.py throws value error运行 export_inference_graph.py 抛出值错误
【发布时间】:2021-03-10 12:39:35
【问题描述】:

我是 StackOverflow 的新手。我正在尝试使用 export_inference_graph.py 导出模型。 我使用 faster_rcnn_inception_v2 在本地训练了我的模型。我正在关注这个tutorial

在命令提示符下输入

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:\Users\Jatin\anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "C:\Users\Jatin\anaconda3\lib\site-packages\absl\app.py", line 303, in run
    _run_main(main, args)
  File "C:\Users\Jatin\anaconda3\lib\site-packages\absl\app.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:\Users\Jatin\anaconda3\lib\site-packages\object_detection\exporter.py", line 604, in export_inference_graph
    detection_model = model_builder.build(pipeline_config.model,
  File "C:\Users\Jatin\anaconda3\lib\site-packages\object_detection\builders\model_builder.py", line 1116, in build
    return build_func(getattr(model_config, meta_architecture), is_training,
  File "C:\Users\Jatin\anaconda3\lib\site-packages\object_detection\builders\model_builder.py", line 583, in _build_faster_rcnn_model
    _check_feature_extractor_exists(frcnn_config.feature_extractor.type)
  File "C:\Users\Jatin\anaconda3\lib\site-packages\object_detection\builders\model_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 提前致谢

【问题讨论】:

    标签: python tensorflow object-detection


    【解决方案1】:

    【讨论】:

    • 但是我怎么去tensorflow版本1.Tf1不可用
    • 最简单的选择是在 colab 中使用 %tensorflow_version 1.x,或者如果在本地使用 conda,则使用 TF 1 创建一个新环境。
    • 但是我在命令提示符下运行它。我是新手。你能帮我更详细一点吗?我正在写上面的命令去这个路径 C:\Users\Jatin\Documents\TensorFlow\models\research\object_detection>
    • 您必须使用 python 安装 tensorflow 1.x 才能导出。安装 anaconda 并在其中设置 TF。 docs.conda.io/projects/conda/en/latest/user-guide/tasks/…
    猜你喜欢
    • 2018-06-08
    • 1970-01-01
    • 2016-08-18
    • 1970-01-01
    • 2017-06-06
    • 1970-01-01
    • 2012-12-09
    • 2012-05-03
    • 2021-10-13
    相关资源
    最近更新 更多