ArashJavan / DeepLIO

Deep Lidar Inertial Odometry
Apache License 2.0
54 stars 10 forks source link

Why is there no pre-trained of fusion-net in config? #11

Closed leyuan-sun closed 3 years ago

leyuan-sun commented 3 years ago

fusion-net: name: "fusion-layer-soft" requires-grad: true # only soft-fusion has trainable params

ArashJavan commented 3 years ago

@rginjapan well, actually fusion-net is only needed when training the whole network (IMU-Net + Lidar-Net + Odometry-Net). During the training, all parameters including the parameters for fusion-layer-soft are saved. If you only train a single component, like Lidar-Net or IMU-Net you do not really need any fusion - since there is nothing to fuse :)

leyuan-sun commented 3 years ago

@rginjapan well, actually fusion-net is only needed when training the whole network (IMU-Net + Lidar-Net + Odometry-Net). During the training, all parameters including the parameters for fusion-layer-soft are saved. If you only train a single component, like Lidar-Net or IMU-Net you do not really need any fusion - since there is nothing to fuse :)

Thanks for your reply! Yes, I know when fusion-net is necessary, so after I trained the whole network, I get the soft-fusion model(ckpt), there is no way to test with pre-trained model in https://github.com/ArashJavan/DeepLIO/blob/master/deeplio/models/nets/__init__.py#:~:text=%23TODO%20enable%20loading,of%20requires-grad. So I just write some code as others which with pre-trained options. if feat_cfg['pretrained']: model_path = feat_cfg['model-path'] load_state_dict(feat_net, model_path) feat_net.pretrained = True

Is it OK?

ArashJavan commented 3 years ago

@rginjapan great, if you like you can apply a PR!

leyuan-sun commented 3 years ago

@rginjapan great, if you like you can apply a PR!

Plz check, I am not sure is it correct in PR.

leyuan-sun commented 3 years ago

If no problem, plz merge.

leyuan-sun commented 3 years ago

Plz check PR12