牛哥带你学代码 2023-09-24 20:28 采纳率: 100%
浏览 39
已结题

YOLO训练模型报错


Transferred 557/566 items from weights/yolov7_training.pt
Scaled weight_decay = 0.0005
Optimizer groups: 95 .bias, 95 conv.weight, 98 other
train: Scanning '..\train\labels.cache' images and labels... 7566 found, 0 missing, 81 empty, 0 corrupted: 100%|██████████| 7566/7566 [00:00<?, ?it/s]
val: Scanning '..\valid\labels.cache' images and labels... 805 found, 0 missing, 11 empty, 0 corrupted: 100%|██████████| 805/805 [00:00<?, ?it/s]

autoanchor: Analyzing anchors... anchors/target = 4.71, Best Possible Recall (BPR) = 0.9997
Image sizes 640 train, 640 test
Using 5 dataloader workers
Logging results to runs\train\exp11
Starting training for 200 epochs...

     Epoch   gpu_mem       box       obj       cls     total    labels  img_size
     0/199     8.92G   0.05505   0.02018   0.01432   0.08955       120       640: 100%|██████████| 473/473 [1:19:46<00:00, 10.12s/it]
               Class      Images      Labels           P           R      mAP@.5  mAP@.5:.95:   0%|          | 0/26 [00:00<?, ?it/s]D:\Users\Lenovo\anaconda3\lib\site-packages\torch\functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at  C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\TensorShape.cpp:2895.)
  return _VF.meshgrid(tensors, **kwargs)  # type: ignore[attr-defined]
               Class      Images      Labels           P           R      mAP@.5  mAP@.5:.95:   0%|          | 0/26 [00:05<?, ?it/s]
Traceback (most recent call last):
  File "E:\vehicle\yolov7\train.py", line 620, in <module>
    train(hyp, opt, device, tb_writer)
  File "E:\vehicle\yolov7\train.py", line 416, in train
    results, maps, times = test.test(data_dict,
  File "E:\vehicle\yolov7\test.py", line 119, in test
    loss += compute_loss([x.float() for x in train_out], targets)[1][:3]  # box, obj, cls
  File "E:\vehicle\yolov7\utils\loss.py", line 469, in __call__
    iou = bbox_iou(pbox.T, tbox[i], x1y1x2y2=False, EIoU=True)  # Eiou(prediction, target)
TypeError: bbox_iou() got an unexpected keyword argument 'EIoU'

请问训练迭代一次epoch后遇到上面情况应该如何处理呀?

  • 写回答

3条回答 默认 最新

  • 爱晚乏客游 2023-09-25 09:09
    关注

    img


    哪来的EIoU,源码中没有这个参数的,如果你要自己换成EIoU,需要在这个代码里面加上这个EIoU的实现

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 10月3日
  • 已采纳回答 9月25日
  • 创建了问题 9月24日