Yolo-FastestV2
Yolo-FastestV2 copied to clipboard
RuntimeError: result type Float can't be cast to the desired output type long int
I tried to training custom dataset but turns out I get this error, please enlighten me
RuntimeError Traceback (most recent call last)
/content/Yolo-FastestV2-Tooth/train.py in
1 frames /content/Yolo-FastestV2-Tooth/utils/loss.py in build_target(preds, targets, cfg, device) 117 # Append 118 a = t[:, 6].long() # anchor indices --> 119 indices.append((b, a, gj.clamp_(0, gain[3] - 1), gi.clamp_(0, gain[2] - 1))) # image, anchor, grid indices 120 tbox.append(torch.cat((gxy - gij, gwh), 1)) # box 121 anch.append(anchors_cfg[a]) # anchors
RuntimeError: result type Float can't be cast to the desired output type long int
do you have a solution ?
at util/loss.py, you may need to change to this in build_target function, then it'll work
indices.append((b, a, gj.clamp_(0, gain[3].long() - 1), gi.clamp_(0, gain[2].long() - 1))) you need edit your code to this one, then will work