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
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
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