models icon indicating copy to clipboard operation
models copied to clipboard

Invalid argument: assertion failed: [maximum box coordinate value is larger than 1.010000: ]

Open monomon opened this issue 8 years ago • 4 comments

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): yes (but using object_detection extensively)
  • OS Platform and Distribution: Windows 10
  • TensorFlow installed from (source or binary): pip
  • TensorFlow version (use command below): tensorflow-gpu 1.4.0
  • Bazel version (if compiling from source): n/a
  • CUDA/cuDNN version: Cuda 8.0 / cudnn64_6
  • GPU model and memory: GeForce GTX 1070
  • Exact command to reproduce: python models/research/object_detection/eval.py ...

Describe the problem

When evaluating on a trained ssd_inception_v2_coco model, I get this error: W C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\framework\op_kernel.cc:1192] Invalid argument: assertion failed: [maximum box coordinate value is larger than 1.010000: ] [447]

Digging deeper into it, I found the following:

  • https://github.com/tensorflow/models/commit/8a72df2d8c62f7ffa2d58995fc5d484e47955546 sets scale_to_absolute to True unconditionally when calling eval_util.result_dict_for_single_example from the evaluator.
  • https://github.com/tensorflow/models/pull/2618/files sets a default for maximum_normalized_coordinate and other arguments of to_absolute_coordinates, thus making the check effective

Now, this creates an expectation that my data comes with normalized coordinates, but I do not think this reflects the paper or any documentation.

So I cannot fully determine whether it is a bug or expected behavior. If the latter is the case, perhaps a preprocessing step is required?

Source code / logs

2017-12-12 11:46:56.149089: W C:\tf_jenkins\home\workspace\rel-win\M\windows-gpu\PY\36\tensorflow\core\framework\op_kernel.cc:1192] Invalid argument: assertion failed: [maximum box coordinate value is larger than 1.010000: ] [447]
[[Node: ToAbsoluteCoordinates_1/Assert/AssertGuard/Assert = Assert[T=[DT_STRING, DT_FLOAT], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](ToAbsoluteCoordinates_1/Assert/AssertGuard/Assert/Switch/_1533, ToAbsoluteCoordinates_1/Assert/AssertGuard/Assert/data_0, ToAbsoluteCoordinates_1/Assert/AssertGuard/Assert/Switch_1/_1535)]]

https://github.com/tensorflow/models/issues/1754 has the same message, but the poster explicitly said they do not experience this with ssd_inception_v2_coco

monomon avatar Dec 12 '17 09:12 monomon

@ebrevdo, any thoughts on this? Is there someone else who would know better?

This looks like ultimately a user-side error, but one that has confused enough people that it deserves some attention.

angerson avatar Dec 13 '17 23:12 angerson

Actually, now I see that https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/using_your_own_dataset.md explicitly points out that normalized coordinates should be used.

I apologize for the churn, having this in the documentation is definitely sufficient. Closing the (non-)issue

monomon avatar Dec 14 '17 08:12 monomon

I think the most important question is your maximum box beyond your boundary, the default is 1.01.Check your code, maybe you mixed the width and height.

SubWayss avatar Jul 19 '18 08:07 SubWayss

The reason I can determine is that my annotation box may be too small. In the use of the fast RCNN, the framework's core/box_list_ops.py code judges some of the framework's processing and causes an error.

lighTQ avatar Jan 25 '19 01:01 lighTQ