cv516Buaa / tph-yolov5

GNU General Public License v3.0
716 stars 170 forks source link

RuntimeError: result type Float can't be cast to the desired output type long int ? #48

Open TerrafYassin opened 2 years ago

TerrafYassin commented 2 years ago

File "/content/drive/MyDrive/Yolo v5/utils/loss.py", line 240, in buildtargets indices.append((b, a, gj.clamp(0, gain[3] - 1), gi.clamp_(0, gain[2] - 1))) # image, anchor, grid indices RuntimeError: result type Float can't be cast to the desired output type long int

manhcuong02 commented 10 months ago

You can fix this bug as follows: indices.append((b, a, gj.clamp(0, gain[3].long() - 1), gi.clamp(0, gain[2].long() - 1))) # image, anchor, grid indices