【问题标题】:(Tensorflow) TypeError: create_estimator_and_inputs() missing 1 required positional argument: 'hparams'(Tensorflow)TypeError:create_estimator_and_inputs()缺少1个必需的位置参数:'hparams'
【发布时间】:2021-04-15 15:58:06
【问题描述】:

我尝试训练模型对象检测并遵循本教程:https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/tensorflow-1.14/training.html

但最后我在 cmd 中执行命令:python model_main.py --alsologtostderr --model_dir=training/ --pipeline_config_path=training/ssd_inception_v2_coco.config

它返回以下几行:

Traceback (most recent call last):
  File "model_main.py", line 108, in <module>
    tf.app.run()
  File "D:\anaconda\envs\py36\lib\site-packages\tensorflow\python\platform\app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "D:\anaconda\envs\py36\lib\site-packages\absl\app.py", line 303, in run
    _run_main(main, args)
  File "D:\anaconda\envs\py36\lib\site-packages\absl\app.py", line 251, in _run_main
    sys.exit(main(argv))
  File "model_main.py", line 70, in main
    FLAGS.sample_1_of_n_eval_on_train_examples))
TypeError: create_estimator_and_inputs() missing 1 required positional argument: 'hparams'

有人遇到过这个问题并知道如何解决吗?

【问题讨论】:

    标签: python tensorflow object-detection object-detection-api


    【解决方案1】:

    确保在培训/验证之前运行这些命令以安装所有必要的包/依赖项并测试安装

    cd models/research
    # Compile protos.
    protoc object_detection/protos/*.proto --python_out=.
    # Install TensorFlow Object Detection API.
    cp object_detection/packages/tf1/setup.py .
    python -m pip install --use-feature=2020-resolver .
    
    # Test the installation
    python object_detection/builders/model_builder_tf1_test.py
    

    Source

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-09-13
      • 1970-01-01
      • 1970-01-01
      • 2019-10-10
      • 2017-03-27
      • 2019-11-12
      • 2019-12-23
      相关资源
      最近更新 更多