跑yolox遇到的BUG

1.

问题:

        Error(s) in loading state_dict for YOLOX:
        size mismatch for head.cls_preds.0.weight: copying a param with shape torch.Size([6, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([8, 128, 1, 1]).
        size mismatch for head.cls_preds.0.bias: copying a param with shape torch.Size([6]) from checkpoint, the shape in current model is torch.Size([8]).
        size mismatch for head.cls_preds.1.weight: copying a param with shape torch.Size([6, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([8, 128, 1, 1]).
        size mismatch for head.cls_preds.1.bias: copying a param with shape torch.Size([6]) from checkpoint, the shape in current model is torch.Size([8]).
        size mismatch for head.cls_preds.2.weight: copying a param with shape torch.Size([6, 128, 1, 1]) from checkpoint, the shape in current model is torch.Size([8, 128, 1, 1]).
        size mismatch for head.cls_preds.2.bias: copying a param with shape torch.Size([6]) from checkpoint, the shape in current model is torch.Size([8]).

原因:

        头一天跑的6个类别的数据集得到的权重参数,第二天又跑的8个类别的数据集,测试六个类别数据时发生的错误。看报错说明预训练权重和本地模型不匹配(本地模型是8个类别,权重参数是六个)。

解决办法:

        1.把YOLOX/yolox/exp/yolox_base.py中的self.num_classes为6(测试数据的类别总数)

        2.命令行输入python setup.py install

2.

问题:

        AttributeError: 'NoneType' object has no attribute 'shape'

原因:

        数据集路径有中文

解决办法:

        把数据路径改过来,或者看看传的图片是否存在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值