(Tensorflow) TypeError: create_estimator_and_inputs() missing 1 required positional argument: 'hparams'

(Tensorflow) TypeError: create_estimator_and_inputs() missing 1 required positional argument: 'hparams'

我尝试训练模型对象检测并按照本教程进行操作: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

它 return 以下几行:

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'

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

确保在 training/validation 之前 运行 这些命令用于安装所有必要的 packages/dependencies 和测试安装

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