-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fix the AssertionError when calling masker in coco_eval.py #213
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed. If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
The performance seems to become bad due to pass masks to Masker, so I decide to drop the PR. |
So the code is not working for you, is that right? |
I got the AssertionError, so I made some changes, and it worked. But later, I found the performance drops when evaluating the results, so I decided to check it again and cancel the PR. I think the below command could reproduce the error, python tools/test_net.py --config-file "configs/caffe2/e2e_mask_rcnn_R_50_FPN_1x_caffe2.yaml" TEST.IMS_PER_BATCH 2 |
I'll investigate this a bit later today, thanks! |
Also, can you tell me what is the AssertionError that you got, just to double check? |
Hi @fmassa 2018-11-26 19:46:20,913 maskrcnn_benchmark.inference INFO: Total inference time: 0:01:23.692130 (0.13390740776062013 s / img per device, on 8 devices)
2018-11-26 19:46:23,992 maskrcnn_benchmark.inference INFO: Preparing results for COCO format
2018-11-26 19:46:23,992 maskrcnn_benchmark.inference INFO: Preparing bbox results
2018-11-26 19:46:24,971 maskrcnn_benchmark.inference INFO: Preparing segm results
0it [00:00, ?it/s]
Traceback (most recent call last):
File "tools/test_net.py", line 94, in <module>
main()
File "tools/test_net.py", line 88, in main
output_folder=output_folder,
File "/home/henrywang/github/maskrcnn-benchmark/maskrcnn_benchmark/engine/inference.py", line 104, in inference
**extra_args)
File "/home/henrywang/github/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/evaluation/__init__.py", line 22, in evaluate
return coco_evaluation(**args)
File "/home/henrywang/github/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/evaluation/coco/__init__.py", line 20, in coco_evaluation
expected_results_sigma_tol=expected_results_sigma_tol,
File "/home/henrywang/github/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/evaluation/coco/coco_eval.py", line 47, in do_coco_evaluation
coco_results["segm"] = prepare_for_coco_segmentation(predictions, dataset)
File "/home/henrywang/github/maskrcnn-benchmark/maskrcnn_benchmark/data/datasets/evaluation/coco/coco_eval.py", line 119, in prepare_for_coco_segmentation
masks = masker(masks, prediction)
File "/home/henrywang/github/maskrcnn-benchmark/maskrcnn_benchmark/modeling/roi_heads/mask_head/inference.py", line 185, in __call__
assert len(boxes) == len(masks), "Masks and boxes should have the same length."
AssertionError: Masks and boxes should have the same length.
|
After checking it again, I want to reopen the PR and wait for your review. |
Oh, I just realized where the problem is actually: when I rebased the Pascal commit, I forgot to add this part of the code. Can you please update your PR with the aforementioned fix, and I'll merge this? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…esearch#213) * fix the same issue as facebookresearch#185 * add fix from the previous change
After applying the changes in #207.
I got the same AssertionError as described in #185 when I executing
python tools/test_net.py --config-file "configs/caffe2/e2e_mask_rcnn_R_50_FPN_1x_caffe2.yaml" TEST.IMS_PER_BATCH 2
It could be fixed by doing the same way as #187 .