XingZeng307 / YOLOv5_with_BiFPN

76 stars 15 forks source link

RuntimeError: result type Float can't be cast to the desired output type __int64 #5

Open Sandara-Git opened 1 year ago

Sandara-Git commented 1 year ago

how to fix this issue?

Traceback (most recent call last):
  File "train.py", line 556, in <module>
    train(hyp, opt, device, tb_writer)
  File "train.py", line 316, in train
    loss, loss_items = compute_loss(pred, targets.to(device))  # loss scaled by batch_size
  File "C:\Users\MSI\Documents\YOLOv5_with_BiFPN-main\utils\loss.py", line 120, in __call__
    tcls, tbox, indices, anchors = self.build_targets(p, targets)  # targets
  File "C:\Users\MSI\Documents\YOLOv5_with_BiFPN-main\utils\loss.py", line 214, in build_targets
    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 __int64