pythontensorflowobject-detectionobject-detection-api

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


I try to train a model object detection and I follow this tutorial: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/tensorflow-1.14/training.html

But at the end I execute the command in the cmd : python model_main.py --alsologtostderr --model_dir=training/ --pipeline_config_path=training/ssd_inception_v2_coco.config

and it return the following lines:

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'

Did someone had this issue and know how to resolve it ?


Solution

  • Make sure that you run these commands before training/validation for installing all the necessary packages/dependencies and testing the installation

    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