(tensorflow )类型错误:create_estimator_and_inputs()缺少1个必需的位置参数:'h参数'

ogsagwnx  于 2023-03-24  发布在  其他
关注(0)|答案(1)|浏览(108)

我尝试训练模型对象检测,并遵循以下教程: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'

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

llmtgqce

llmtgqce1#

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

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

来源

相关问题