在使用pycharm+pytorch进行YOLOV3-spp进行预训练权重进行训练时出现报错
报错内容如下:
Traceback (most recent call last):
File "E:\PycharmProjects\deep-learning-for-image-processing-master\pytorch_object_detection\yolov3_spp\train.py", line 302, in
train(hyp)
File "E:\PycharmProjects\deep-learning-for-image-processing-master\pytorch_object_detection\yolov3_spp\train.py", line 208, in train
scaler=scaler)
File "E:\PycharmProjects\deep-learning-for-image-processing-master\pytorch_object_detection\yolov3_spp\train_utils\train_eval_utils.py", line 61, in train_one_epoch
loss_dict = compute_loss(pred, targets, model)
File "E:\PycharmProjects\deep-learning-for-image-processing-master\pytorch_object_detection\yolov3_spp\build_utils\utils.py", line 213, in compute_loss
tcls, tbox, indices, anchors = build_targets(p, targets, model) # targets
File "E:\PycharmProjects\deep-learning-for-image-processing-master\pytorch_object_detection\yolov3_spp\build_utils\utils.py", line 297, 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)