Nightmare-n / UniPAD

UniPAD: A Universal Pre-training Paradigm for Autonomous Driving (CVPR 2024)
https://arxiv.org/abs/2310.08370
Apache License 2.0
150 stars 5 forks source link

how to merge the weights of uvtr_lidar and uvtr_cam #19

Closed hbzhou530 closed 1 week ago

hbzhou530 commented 1 week ago

Thank you for your meaningful work. How to get merged_uvtr_fusion_vs0.075_finetune.pth

Nightmare-n commented 1 week ago

Please use the following pseudo-code to merge the weights:

image_branch = torch.load('uvtr_cam_xxx.pth', map_location='cpu')
lidar_branch = torch.load('uvtr_lidar_xxx.pth', map_location='cpu')
fusion = {}
fusion['state_dict'] = {**image_branch['state_dict'], **lidar_branch['state_dict']}
torch.save(fusion, 'uvtr_fusion_xxx.pth')