PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.38k stars 2.84k forks source link

Ambiguity weight backbone.res5.res5a.branch2a.norm._mean loaded, it matches at least bbox_head.head.res5.res5a.branch2a.norm._mean and backbone.res5.res5a.branch2a.norm._mean in the model #7331

Closed monkeycc closed 1 year ago

monkeycc commented 1 year ago

问题确认 Search before asking

Bug组件 Bug Component

Training

Bug描述 Describe the Bug

python tools/train.py -c configs/faster_rcnn/faster_rcnn_r34_vd_fpn_1x_VOC.yml --eval -o use_gpu=true


W1114 23:07:29.199206 18108 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 11.6, Runtime API Version: 11.6
W1114 23:07:30.581168 18108 gpu_resources.cc:91] device: 0, cuDNN Version: 8.2.
[11/14 23:07:31] ppdet.utils.checkpoint INFO: The shape [512, 256, 3, 3] in pretrained weight backbone.res5.res5a.branch2a.conv.weight is unmatched with the shape [512, 1024, 1, 1] in model bbox_head.head.res5.res5a.branch2a.conv.weight. And the weight backbone.res5.res5a.branch2a.conv.weight will not be loaded
Traceback (most recent call last):
  File "tools/train.py", line 172, in <module>
    main()
  File "tools/train.py", line 168, in main
    run(FLAGS, cfg)
  File "tools/train.py", line 129, in run
    trainer.load_weights(cfg.pretrain_weights)
  File "D:\0SDXX\PaddleDetection\ppdet\engine\trainer.py", line 375, in load_weights
    load_pretrain_weight(self.model, weights)
  File "D:\0SDXX\PaddleDetection\ppdet\utils\checkpoint.py", line 215, in load_pretrain_weight
    param_state_dict = match_state_dict(model_dict, param_state_dict)
  File "D:\0SDXX\PaddleDetection\ppdet\utils\checkpoint.py", line 194, in match_state_dict
    weight_key]))
ValueError: Ambiguity weight backbone.res5.res5a.branch2a.norm._mean loaded, it matches at least bbox_head.head.res5.res5a.branch2a.norm._mean and backbone.res5.res5a.branch2a.norm._mean in the model

复现环境 Environment

win11 python3.7 paddlepaddle-gpu 2.3.2.post116 paddledet 2.5.0


├── annotations
│   ├── road0.xml
│   ├── road1.xml
│   ├── road10.xml
│   |   ...
├── images
│   ├── road0.jpg
│   ├── road1.jpg
│   ├── road2.jpg
│   |   ...
├── label_list.txt
├── test.txt
├── train.txt
└── valid.txt

pretrain_weights: https://paddledet.bj.bcebos.com/models/pretrained/ResNet34_vd_pretrained.pdparams

Bug描述确认 Bug description confirmation

是否愿意提交PR? Are you willing to submit a PR?

nemonameless commented 1 year ago

faster_rcnn_r34_vd_fpn_1x_coco.yml 测试过无误,还改动了什么请说明。

monkeycc commented 1 year ago

应该配置错误,已解决