traveller59 / second.pytorch

SECOND for KITTI/NuScenes object detection
MIT License
1.73k stars 722 forks source link

Different state_dic in pre-trained model #28

Closed PeiyanGong closed 6 years ago

PeiyanGong commented 6 years ago

Hello,

Thank you for sharing your code. This is such an excellent work.

I am trying to get the pre-trained model working on my computer. I did the change on SparseConvnet according to your README and rebuild the SparseConvnet. However, when I try to run evaluation with your pre-trained model, I got the following error: screenshot from 2018-11-02 14-57-24

From my understanding, this is caused by different names between the current convnet middle layer and the pretrain model. So I cannot load the pretrain model on convnet middle layer. I tried to load the pre-trained model with "load_state_dict(state_dict, strict=False)" but clearly all conv layers are still not loaded. This is verified by the source code. What would you suggest to do to fix it? I am thinking about opening the voxelnet-204270.tckpt file somehow and edit the state_dict but no succeeding.

Thanks for your time. Vince

traveller59 commented 6 years ago

The SparseConvNet change parameter's name (batchnorm) in 55d55a6 and break old checkpoints again. You may need to load that ckpt and set weights manually. I have no time to do this currently.

PeiyanGong commented 6 years ago

Found it and going to fix it. The following link shows that some parameters' name is changed. I am going to change those back and rebuild the SparseConvNet. https://github.com/facebookresearch/SparseConvNet/commit/55d55a6a9fc3f7c1c8b92317772ccf7955712a6e Thanks a lot. This issue will be closed after I successfully run the pre-train model.