LiDAR-MOS icon indicating copy to clipboard operation
LiDAR-MOS copied to clipboard

how to change the "n_input_scans"?

Open pikaqiu0131 opened this issue 1 year ago • 5 comments

I only change the "arch_cfg.yaml" in model ,but there is a error:size mismatch for module.downCntx.conv1.weight: copying a param with shape torch.Size([32, 6, 1, 1]) from checkpoint, the shape in current model is torch.Size([32, 13, 1, 1]),so how to change the "n_input_scans"?thank you :)

pikaqiu0131 avatar Jul 11 '22 12:07 pikaqiu0131

Hi @pikaqiu0131 , could you provided the cfg.yaml you used. It should be noted that there are two n_input_scans keys in the config, you should keep them consistent, and change them at the same time. https://github.com/PRBonn/LiDAR-MOS/blob/c638e8b5cecc26b4b11c4421aa37f9c51acddc87/mos_SalsaNext/salsanext_mos.yml#L25

https://github.com/PRBonn/LiDAR-MOS/blob/c638e8b5cecc26b4b11c4421aa37f9c51acddc87/mos_SalsaNext/salsanext_mos.yml#L73

MaxChanger avatar Jul 11 '22 14:07 MaxChanger

Here is the key error:

File "../..//tasks/semantic/dataset/kitti/parser.py", line 246, in getitem
exec("residual_file" + str(i+1) + " = " + "self.residual_files" + str(i+1) + "[seq][index]")
File "", line 1, in
IndexError: list index out of range

I guess that the corresponding number of Residual_Images are not generated. You can check whether there are 8 corresponding Residual Image folders in the dataset directory, If set n_input_scans = 8.

We provide a slightly automated script, you can refer to the README in that repo. https://github.com/haomo-ai/MotionSeg3D/blob/master/utils/auto_gen_residual_images.py

MaxChanger avatar Jul 11 '22 14:07 MaxChanger

thank you a lot! I change my document and run it successfully! and If I want to change n=7, I need train my model by myself?or just change the n_inputs in "arch_cfg.yaml" in model 8 ? thank you for your reply:)

pikaqiu0131 avatar Jul 12 '22 06:07 pikaqiu0131

Yeah, I also think you need to re-train the network with n_inputs_scans=7, if this repo did not provided this checkpoint in README. Because the input channel of the Conv2D is changed. If you directly use the pretrained model (n=8) and only change the n-->7, I think there will be an error when loading the pretrained model, you could simplely try and see if it works.

https://github.com/PRBonn/LiDAR-MOS/blob/c638e8b5cecc26b4b11c4421aa37f9c51acddc87/mos_SalsaNext/train/tasks/semantic/modules/SalsaNext.py#L178-L190

MaxChanger avatar Jul 12 '22 06:07 MaxChanger

thank you !!

pikaqiu0131 avatar Jul 12 '22 06:07 pikaqiu0131