深度学习error记录(自用|持续更新)

本文记录了在深度学习过程中遇到的几个典型错误及其解决办法,包括:CUDA后端运行torchvision::nms出错、train.py命令缺少数据路径、模型加载时state_dict不匹配以及张量尺寸不匹配的问题。通过调整torchvision版本、修正argparse参数定义、调整模型加载策略和处理图像模式,可以解决这些问题。
摘要由CSDN通过智能技术生成

1.RuntimeError: Could not run ‘torchvision::nms’ with arguments from the ‘CUDA’ backend.

Traceback (most recent call last):
    File "/opt/yyl/yolov5/train.py", line 543, in <module>
        train(hyp, opt, device, tb_writer)
    File "/opt/yyl/yolov5/train.py", line 355, in train
        results, maps, times = test.test(data_dict,
    File "/opt/yyl/yolov5/test.py", line 122, in test
        out = non_max_suppression(out, conf_thres, iou_thres, labels=lb, multi_label=True, agnostic=single_cls)
    File "/opt/yyl/yolov5/utils/general.py", line 560, in non_max_suppression
        i = torchvision.ops.nms(boxes, scores, iou_thres)  # NMS
    File "/root/anaconda3/envs/py38_torch16/lib/python3.8/site-packages/torchvision/ops/boxes.py", line 42, in nms
       return torch.ops.torchvision.nms
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值