pytorch-ssd icon indicating copy to clipboard operation
pytorch-ssd copied to clipboard

GPU tensor to int conversion bugs

Open tensorturtle opened this issue 4 years ago • 0 comments

Fixes #147 and related bugs. Issue #147 happens because when running on GPU, some tensors are moved to GPU while others are still in CPU. This becomes a problem in /vision/utils/box_utils.py, when an operation tries to work on tensors that are in different places. I fixed another bug which happened because OpenCV's cv2.rectangle does not accept tensors as arguments. I fixed it by getting the python numerical value of the tensor with .item() and converting it to int.

tensorturtle avatar Jan 19 '21 19:01 tensorturtle