Closed yaniv-f closed 2 years ago
Sorry for the late reply. You can try to set load_from
in the config to achieve your goal and check the initialization in the log file.
Hi Tai-Wang. Thanks for your feedback ! So in summary, for question #1 I guess I can iterate over the state_dict and transfer the weights to the corresponding part of the new mode and for question #2 you confirm that load_from on part of the model will work. Thanks and best regards,
Yaniv
Hi. I find mmdetection3d very useful! I have two questions:
As initialization for the weights of the above parts of my model, I would like to use the checkpoint from mmdetection3d training of nuImages, the model config is at https://github.com/open-mmlab/mmdetection3d/blob/master/configs/nuimages/mask_rcnn_r50_fpn_1x_nuim.py (linked from the first row of the instance segmentation results at https://github.com/open-mmlab/mmdetection3d/blob/master/configs/nuimages/README.md ) and the checkpoint is https://download.openmmlab.com/mmdetection3d/v0.1.0_models/nuimages_semseg/mask_rcnn_r50_fpn_1x_nuim/mask_rcnn_r50_fpn_1x_nuim_20201008_195238-e99f5182.pth
Inside the above .pth checkpoint file, there are model weights such as
My question is: Is there a way to load the weights from your checkpoint to my model without writing specific code that iterates over all of the state_dict keys and copying to the corresponding keys in my model ? (something similar to what is done in https://github.com/open-mmlab/mmdetection3d/blob/master/tools/model_converters/regnet2mmdet.py and in https://github.com/open-mmlab/mmdetection3d/blob/master/tools/model_converters/convert_votenet_checkpoints.py )
Thanks,
Yaniv