Open ehratjon opened 1 year ago
gpu_tensor.any()
# tensor(True, device='cuda:0')
any(list(gpu_tensor.flatten()))
# False
I cant reproduce this. output is False both times for me.
Oh super wired! I don't know why this could happen on one system but not on another. As you can see, I am using torch version: '2.0.1+rocm5.4.2'. I had some trouble installing the GPU drivers, but I would assume this doesn't affect how pytorch behaves. After trying with a fresh install of torch (pip3 install torch --index-url https://download.pytorch.org/whl/rocm5.4.2) I still have the same output.
Do you think this is an issue with the rocm version of torch? Any suggestions on how to investigate this further and would the ROCm github be the right place to submit the issue?
I don't have any idea how this could happen..
this could be the pytorch + rocm issue; cause i tried it on nvidia gpus, and code is working perfectly as expected
I think the best way to confirm this behaviour is making a docker environment and reproduce it.
Then someone from pytorch can have a look at this.
🐛 Describe the bug
Existing issues: There is no issue on this topic. Issue #6787 has a discussion on the assert statement on degenerate bboxes.
Problem description: When running a model that makes use of GeneralizedRCNN on GPU bounding boxes are always detected as degenerate. The model then throws the following error: ValueError: All bounding boxes should have positive height and width. Found invalid box [x1, y1, x2, y2] for target index 0.
Cause of the problem: The problem occurs because in generalized_rcnn.py on line 91. The problem is that '.any()' returns the correct values on CPU but not on GPU.
Problem solution: I solved the issue by manually going into the side packages (venv/lib/python3.10/site-packages/torchvision/models/detection/generalized_rcnn.py) and changing line 91 to:
I hope this helps anyone running into the same problem.
Question: I am not sure if this is the most elegant solution and there is a TODO-comment wanting this part to be moved to a new function. Should I nevertheless open a PR to just change this line or is there already work done on this?
Versions
> python collect_env.py
Collecting environment information...