Indexing error in RPNLossComputation.prepare_targets
See original GitHub issue🐛 Bug
File "/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/rpn.py", line 100, in forward
return self._forward_train(anchors, objectness, rpn_box_regression, targets)
File "/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/rpn.py", line 119, in _forward_train
anchors, objectness, rpn_box_regression, targets
File "/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/loss.py", line 91, in __call__
labels, regression_targets = self.prepare_targets(anchors, targets)
File "/maskrcnn-benchmark/maskrcnn_benchmark/modeling/rpn/loss.py", line 62, in prepare_targets
labels_per_image[~anchors_per_image.get_field("visibility")] = -1
RuntimeError: The shape of the mask [5118] at index 0 does not match the shape of the indexed tensor [0] at index 0
I am getting this error and I have no idea why… At some point in RPNLossComputation.prepare_targets
, matched_targets
is a BoxList
with num_boxes=0
, resulting in an empty tensor in labels_per_image
and subsequently in a indexing error down the line.
Environment
Docker image
PyTorch version: 1.0.0.dev20181119
Is debug build: No
CUDA used to build PyTorch: 9.0.176
OS: Ubuntu 16.04.4 LTS
GCC version: (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
CMake version: version 3.5.1
Python version: 3.6
Is CUDA available: Yes
CUDA runtime version: 9.0.176
GPU models and configuration:
GPU 0: Tesla V100-DGXS-16GB
GPU 1: Tesla V100-DGXS-16GB
GPU 2: Tesla V100-DGXS-16GB
GPU 3: Tesla V100-DGXS-16GB
Nvidia driver version: 384.145
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.7.1.2
/usr/lib/x86_64-linux-gnu/libcudnn_static_v7.a
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Nsight Compute - NVIDIA Documentation Center
When installing from a .deb or .rpm package, it is located in /opt/nvidia/nsight-compute/<version> to be consistent with Nsight Systems.
Read more >How RPM Repository Indexing Works in Artifactory - JFrog
An asynchronous calculation is based on intercepting file operations and adding the necessary indexing operation to an internal Artifactory ...
Read more >Upgrading from RHEL 7 to RHEL 8 Red Hat Enterprise Linux 8
Enable and synchronize all required RHEL 7 and RHEL 8 repositories with the latest updates for RHEL 7.9 and the target OS version,...
Read more >Real-Time Performance Monitoring | Junos OS
With the RPM tool, you configure and send probes to a specified target and monitor the analyzed results to determine packet loss, round-trip...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The error points down to the fact that there is not GT for one image that has been fed, that is kind of clear from the error message and there is BTW and open PR to improve this error message in https://github.com/facebookresearch/maskrcnn-benchmark/pull/37
If you are adding random crops in your transforms, that is probably the culprit.
We don’t add random crops by default (this option is not even present in the current codebase actually)