tensorflow / tensorflow/models
Failed to convert a series BatchNMS ops to a single combinedNMS op
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.7k
- Forks
- 44.8k
- PR merge metrics
- No merged PRs in 30d
Description
Prerequisites
Please answer the following questions for yourself before submitting an issue.
- I am using the latest TensorFlow Model Garden release and TensorFlow 2.
- I am reporting the issue to the correct repository. (Model Garden official or research directory)
- I checked to make sure that this issue has not already been filed.
1. The entire URL of the file you are using
2. Describe the bug
When converting a series of NMS ops used in a FasterRCNN model to a combinedNMS op. The research/object_detection/core/post_processing.py will raise an unexpected error.
3. Steps to reproduce
- Download a FasterRCNN model from the TF1 model zoo and install the object_detection API by following the given guideline
- unzip your downloaded model and modify the pipeline.config
second_stage_post_processing {
batch_non_max_suppression {
score_threshold: 0.300000011921
iou_threshold: 0.600000023842
max_detections_per_class: 100
max_total_detections: 100
use_combined_nms: true #add one line
}
score_converter: SOFTMAX
}
- convert the FasterRCNN model by using research/object_detection/export_inference_graph.py
python ./object_detection/export_inference_graph.py \
--input_type image_tensor \
--pipeline_config_path ./object_detection/faster_rcnn_resnet50_coco_2018_01_28/pipeline.config \
--trained_checkpoint_prefix ./object_detection/faster_rcnn_resnet50_coco_2018_01_28/model.ckpt \
--output_directory ./object_detection/faster_rcnn_resnet50_coco_2018_01_28/output/
4. Expected behavior
I expect that all NMS ops will be combined into a single CombinedNMS op. However, it raises an unexpected error shown in next part.
According to my own understanding, when setting use_combined_nms=true, these variables, including change_coordinate_frame,num_valid_boxes, use_class_agnostic_nms, soft_nms_sigma, clip_window would be the default values. However, it still raises an error message like ValueError: change_coordinate_frame (normalizing coordinates relative to clip_window) is not supported by combined_nms.**
I also tried to set these above variables to their default values in the pipeline.config explicitly. but it also couldn't work.
5. Additional context
The log I got could be found here.
File "/home/gta/miniconda3/envs/tf1/lib/python3.7/site-packages/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 1548, in postprocess
mask_predictions=mask_predictions)
File "/home/gta/miniconda3/envs/tf1/lib/python3.7/site-packages/object_detection/meta_architectures/faster_rcnn_meta_arch.py", line 2133, in _postprocess_box_classifier
masks=mask_predictions_batch)
File "/home/gta/miniconda3/envs/tf1/lib/python3.7/site-packages/object_detection/core/post_processing.py", line 1000, in batch_multiclass_non_max_suppression
'change_coordinate_frame (normalizing coordinates'
ValueError: change_coordinate_frame (normalizing coordinates relative to clip_window) is not supported by combined_nms.
6. System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu20.04
- Mobile device name if the issue happens on a mobile device:
- TensorFlow installed from (source or binary):binary
- TensorFlow version (use command below):conda install tensorflow==1.14
- Python version:3.7
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version:
- GPU model and memory:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.