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
Hi,
I am trying to text the FLyolo using quick start example.
I run train.py but I got the error below
Starting training for 5 epochs...
Epoch gpu_mem box obj cls labels img_size
0%| | 0/12 [00:08<?, ?it/s]
Traceback (most recent call last):
File "C:\temp\CarlaFLCAV\FLYolo\yolov5\train.py", line 628, in <module>
main(opt)
File "C:\temp\CarlaFLCAV\FLYolo\yolov5\train.py", line 525, in main
train(opt.hyp, opt, device, callbacks)
File "C:\temp\CarlaFLCAV\FLYolo\yolov5\train.py", line 322, in train
loss, loss_items = compute_loss(pred, targets.to(device)) # loss scaled by batch_size
File "C:\temp\CarlaFLCAV\FLYolo\yolov5\utils\loss.py", line 120, in __call__
tcls, tbox, indices, anchors = self.build_targets(p, targets) # targets
File "C:\temp\CarlaFLCAV\FLYolo\yolov5\utils\loss.py", line 217, 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
It would be appreciated if you can help.
Thanks
Duaa
The text was updated successfully, but these errors were encountered:
It seems that the problem occured due to the torch version. You may change "gain = torch.ones(7, device=targets.device)" into "gain = torch.ones(7, device=targets.device).long()" in file loss.py under folder "yolov5/utils" (C:\temp\CarlaFLCAV\FLYolo\yolov5\utils\loss.py)
Hi,
I am trying to text the FLyolo using quick start example.
I run train.py but I got the error below
It would be appreciated if you can help.
Thanks
Duaa
The text was updated successfully, but these errors were encountered: