在谷歌colab上训练yolov5 2.0的模型,训练时遇到问题如下:
Analyzing anchors... Best Possible Recall (BPR) = 1.0000
Image sizes 640 train, 640 test
Using 2 dataloader workers
Starting training for 300 epochs...
Epoch gpu_mem GIoU obj cls total targets img_size
0% 0/93 [00:14<?, ?it/s]
Traceback (most recent call last):
File "train.py", line 469, in <module>
train(hyp, tb_writer, opt, device)
File "train.py", line 291, in train
loss, loss_items = compute_loss(pred, targets.to(device), model) # scaled by batch_size
File "/content/yolov5-2.0/utils/utils.py", line 444, in compute_loss
tcls, tbox, indices, anchors = build_targets(p, targets, model) # targets
File "/content/yolov5-2.0/utils/utils.py", line 533, in build_targets
a, t = at[j], t.repeat(na, 1, 1)[j] # filter
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)
这个是什么原因造成的,需要怎样修改?求能指点迷津!