open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
28.52k stars 9.29k forks source link

How to modify the conv1 of the pre training weights of the Mask RCnn to fit my 5-channel dataset #11687

Open MoonDiana17 opened 1 month ago

MoonDiana17 commented 1 month ago

Describe the issue

In order to increase the number of channels to 5, I have made some modifications to the code. Until this step, I knew that the conv1 of the pre training weight did not match the number of channels in the input image, but I didn't know how to correct it. Even if I set init_cfg=None, I will still report an error.

Reproduction

  1. What command or script did you run?
python tools/train.py work_dirs/mask-rcnn_r101-caffe_fpn_ms-poly-3x_coco/mask-rcnn_r101-caffe_fpn_ms-poly-3x_coco.py

Snipaste_2024-05-07_17-31-56