Skip to content

Object detection AttributeError: use_combined_nms #7762

@hsparrow

Description

@hsparrow

System information

  • What is the top-level directory of the model you are using: object_detection
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): no
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): OS X 10.14.1
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): 1.15.0
  • Bazel version (if compiling from source):
  • CUDA/cuDNN version: no
  • GPU model and memory: no GPU
  • Exact command to reproduce:

Describe the problem

Previously, I've successfully trained a custom detector with an older version of training executable script but the same configuration, which now failed on tf.contrib. Now I'm trying to reproduce it. The custom detector is based on pre-trained ssd_inception_v2_coco with object detection API, the error AttributeError: use_combined_nms occurs as following traceback shows. No modification to the object_detection/model_main.py script. It seems there is no use_combined_nms attribute set in the postprocessing config.

Source code / logs

Training command:

python3 model_main.py --alsologtostderr --model_dir=training/ --pipeline_config_path=training/ssd_inception_v2_coco.config --num_train_steps=10 --sample_1_of_n_eval_examples=1

Traceback stack

Traceback (most recent call last):
  File "model_main.py", line 105, in <module>
    tf.app.run()
  File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/platform/app.py", line 40, in run
    _run(main=main, argv=argv, flags_parser=_parse_flags_tolerate_undef)
  File "/usr/local/lib/python3.7/site-packages/absl/app.py", line 299, in run
    _run_main(main, args)
  File "/usr/local/lib/python3.7/site-packages/absl/app.py", line 250, in _run_main
    sys.exit(main(argv))
  File "model_main.py", line 101, in main
    tf.estimator.train_and_evaluate(estimator, train_spec, eval_specs[0])
  File "/usr/local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/training.py", line 473, in train_and_evaluate
    return executor.run()
  File "/usr/local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/training.py", line 613, in run
    return self.run_local()
  File "/usr/local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/training.py", line 714, in run_local
    saving_listeners=saving_listeners)
  File "/usr/local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 370, in train
    loss = self._train_model(input_fn, hooks, saving_listeners)
  File "/usr/local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1161, in _train_model
    return self._train_model_default(input_fn, hooks, saving_listeners)
  File "/usr/local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1188, in _train_model_default
    input_fn, ModeKeys.TRAIN))
  File "/usr/local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1025, in _get_features_and_labels_from_input_fn
    self._call_input_fn(input_fn, mode))
  File "/usr/local/lib/python3.7/site-packages/tensorflow_estimator/python/estimator/estimator.py", line 1116, in _call_input_fn
    return input_fn(**kwargs)
  File "/Users/kk/PycharmProjects/Tensorflow/models/research/object_detection/inputs.py", line 476, in _train_input_fn
    params=params)
  File "/Users/kk/PycharmProjects/Tensorflow/models/research/object_detection/inputs.py", line 542, in train_input
    model_config, is_training=True).preprocess
  File "/Users/kk/PycharmProjects/Tensorflow/models/research/object_detection/builders/model_builder.py", line 634, in build
    add_summaries)
  File "/Users/kk/PycharmProjects/Tensorflow/models/research/object_detection/builders/model_builder.py", line 272, in _build_ssd_model
    ssd_config.post_processing)
  File "/Users/kk/PycharmProjects/Tensorflow/models/research/object_detection/builders/post_processing_builder.py", line 59, in build
    post_processing_config.batch_non_max_suppression)
  File "/Users/kk/PycharmProjects/Tensorflow/models/research/object_detection/builders/post_processing_builder.py", line 91, in _build_non_max_suppressor
    if nms_config.use_combined_nms and nms_config.use_class_agnostic_nms:
AttributeError: use_combined_nms

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions