目标检测YOLO系列:训练模型过程中遇到的各种问题总结

1. _pickle.UnpicklingError: STACK_GLOBAL requires str

产生原因:之前的数据集训练过,导致数据集文件夹中生成.cache的缓存文件。

解决:找到数据集文件夹中的全部.cache文件,进行删除

2. yolov7报错 indices should be either on cpu or on the same device as the indexed tensor (cpu)

产生原因:部分在GPU上运行,部分在CPU上运行

解决:在loss.py文件 中,修改对应报错的 ComputeLossOTA类下build_targets方法,添加.to(device),共修改三处。

        1. 修改一:添加device = torch.device(targets.device)为

        2. 修改二:修改from_which_layer.append(torch.ones(size=(len(b),)) * i)为from_which_layer.append((torch.ones(size=(len(b),)) * i).to(device))

        3. 修改三:matching_matrix = torch.zeros_like(cost)为matching_matrix = torch.zeros_like(cost, device=device)
主要参考:yolov7报错 indices should be either on cpu or on the same device as the indexed tensor (cpu)解决-CSDN博客

3. 解决:yolov7 UnicodeDecodeError: 'gbk' codec can't decode byte 0x88 in position 507: illegal multibyte sequence

解决:yaml文件中有中文注释,将所有中文注释删除即可。

  • 6
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值