We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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 108 preds = model(imgs) 109 # loss计算 --> 110 iou_loss, obj_loss, cls_loss, total_loss = utils.loss.compute_loss(preds, targets, cfg, device) 111 112 # 反向传播求解梯度
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
The text was updated successfully, but these errors were encountered:
do you have a solution ?
Sorry, something went wrong.
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
No branches or pull requests
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
108 preds = model(imgs)
109 # loss计算
--> 110 iou_loss, obj_loss, cls_loss, total_loss = utils.loss.compute_loss(preds, targets, cfg, device)
111
112 # 反向传播求解梯度
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
The text was updated successfully, but these errors were encountered: