You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently trying to train either yolov7 or v5 and I am getting the same error when I run the training script for both: Traceback (most recent call last): File "train.py", line 695, in <module> main(opt) File "train.py", line 591, in main train(opt.hyp, opt, device, callbacks) File "train.py", line 376, in train loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size File "/content/yoloair/utils/loss.py", line 123, in __call__ tcls, tbox, indices, anchors = self.build_targets(p, targets) # targets File "/content/yoloair/utils/loss.py", line 222, 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 long int
Is there an obvious mistake that I am making? I'm only changing the config and using the following to train:
change line 222 into: indices.append((b, a, gj.clamp_(0, shape[2] - 1), gi.clamp_(0, shape[3] - 1)))
add one line code before line 222: shape = p[i].shape
change line 222 into: indices.append((b, a, gj.clamp_(0, shape[2] - 1), gi.clamp_(0, shape[3] - 1))) add one line code before line 222: shape = p[i].shape
I'm currently trying to train either yolov7 or v5 and I am getting the same error when I run the training script for both:
Traceback (most recent call last): File "train.py", line 695, in <module> main(opt) File "train.py", line 591, in main train(opt.hyp, opt, device, callbacks) File "train.py", line 376, in train loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size File "/content/yoloair/utils/loss.py", line 123, in __call__ tcls, tbox, indices, anchors = self.build_targets(p, targets) # targets File "/content/yoloair/utils/loss.py", line 222, 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 long int
Is there an obvious mistake that I am making? I'm only changing the config and using the following to train:
!python train.py --data coco128.yaml --weights '' --cfg /content/yoloair/configs/yolov5-Improved/yolov5s_mobileone_backbone.yaml --img 640 --epochs 3 --device 0
Any help would be appreciated!
The text was updated successfully, but these errors were encountered: