donghongsaber 2022-02-16 15:59 采纳率: 0%
浏览 1637

使用mmdetection进行测试时,出现The model and loaded state dict do not match exactly的问题

mmdetection的初学者,在使用faster-rcnn进行coco数据集和voc数据集测试的时候,均出现了The model and loaded state dict do not match exactly的问题。

The model and loaded state dict do not match exactly

size mismatch for roi_head.bbox_head.fc_cls.weight: copying a param with shape torch.Size([21, 1024]) from checkpoint, the shape in current model is torch.Size([2, 1024]).
size mismatch for roi_head.bbox_head.fc_cls.bias: copying a param with shape torch.Size([21]) from checkpoint, the shape in current model is torch.Size([2]).
size mismatch for roi_head.bbox_head.fc_reg.weight: copying a param with shape torch.Size([80, 1024]) from checkpoint, the shape in current model is torch.Size([4, 1024]).
size mismatch for roi_head.bbox_head.fc_reg.bias: copying a param with shape torch.Size([80]) from checkpoint, the shape in current model is torch.Size([4]).
completed: 0, elapsed: 0s
---------------iou_thr: 0.5---------------
Traceback (most recent call last):
  File "tools/test.py", line 237, in <module>
    main()
  File "tools/test.py", line 229, in main
    metric = dataset.evaluate(outputs, **eval_kwargs)
  File "/home/ccf_disk/hzl/anaconda3/envs/mmlab/lib/python3.7/site-packages/mmdet/datasets/voc.py", line 85, in evaluate
    use_legacy_coordinate=True)
  File "/home/ccf_disk/hzl/anaconda3/envs/mmlab/lib/python3.7/site-packages/mmdet/core/evaluation/mean_ap.py", line 353, in eval_map
    num_classes = len(det_results[0])  # positive class num
IndexError: list index out of range
(mmlab) huangzhenglin@lab317-PowerEdge-R940xa:/home/ccf_disk/hzl/mmdetection$ 


请问这是什么原因?感激不尽

  • 写回答

1条回答 默认 最新

  • ty94666 2022-02-16 16:36
    关注

    IndexError: list index out of range

    这不是都写了吗,某个数组越界了,断点调试看看是不是索引的问题

    评论

报告相同问题?

问题事件

  • 创建了问题 2月16日

悬赏问题

  • ¥15 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了