huixiancheng / No-CPGNet

Non-official implementation of CPGNet
7 stars 2 forks source link

训练好的模型pth提示缺少参数 #2

Open liukang1811 opened 1 year ago

liukang1811 commented 1 year ago

Traceback (most recent call last): File "evaluate.py", line 155, in main(args, config) File "evaluate.py", line 125, in main model.load_state_dict(checkpoint['model_state_dict'], strict=True) File "/home/liuk/anaconda3/envs/cpgnet/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1482, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for AttNet: Missing key(s) in state_dict: "bev_net.up0.att_layer.0.weight", "bev_net.up0.att_layer.1.weight", "bev_net.up0.att_layer.1.bias", "bev_net.up0.att_layer.1.running_mean", "bev_net.up0.att_layer.1.running_var", "bev_net.up0.att_layer.3.weight", "bev_net.up0.att_layer.3.bias", "bev_net.up0.conv_high.0.weight", "bev_net.up0.conv_high.1.weight", "bev_net.up0.conv_high.1.bias", "bev_net.up0.conv_high.1.running_mean", "bev_net.up0.conv_high.1.running_var", "bev_net.up0.conv_low.0.weight", "bev_net.up0.conv_low.1.weight", "bev_net.up0.conv_low.1.bias", "bev_net.up0.conv_low.1.running_mean", "bev_net.up0.conv_low.1.running_var", "rv_net.up0.att_layer.0.weight", "rv_net.up0.att_layer.1.weight", "rv_net.up0.att_layer.1.bias", "rv_net.up0.att_layer.1.running_mean", "rv_net.up0.att_layer.1.running_var", "rv_net.up0.att_layer.3.weight", "rv_net.up0.att_layer.3.bias", "rv_net.up0.conv_high.0.weight", "rv_net.up0.conv_high.1.weight", "rv_net.up0.conv_high.1.bias", "rv_net.up0.conv_high.1.running_mean", "rv_net.up0.conv_high.1.running_var", "rv_net.up0.conv_low.0.weight", "rv_net.up0.conv_low.1.weight", "rv_net.up0.conv_low.1.bias", "rv_net.up0.conv_low.1.running_mean", "rv_net.up0.conv_low.1.running_var", "bev_net_2.up0.att_layer.0.weight", "bev_net_2.up0.att_layer.1.weight", "bev_net_2.up0.att_layer.1.bias", "bev_net_2.up0.att_layer.1.running_mean", "bev_net_2.up0.att_layer.1.running_var", "bev_net_2.up0.att_layer.3.weight", "bev_net_2.up0.att_layer.3.bias", "bev_net_2.up0.conv_high.0.weight", "bev_net_2.up0.conv_high.1.weight", "bev_net_2.up0.conv_high.1.bias", "bev_net_2.up0.conv_high.1.running_mean", "bev_net_2.up0.conv_high.1.running_var", "bev_net_2.up0.conv_low.0.weight", "bev_net_2.up0.conv_low.1.weight", "bev_net_2.up0.conv_low.1.bias", "bev_net_2.up0.conv_low.1.running_mean", "bev_net_2.up0.conv_low.1.running_var", "rv_net_2.up0.att_layer.0.weight", "rv_net_2.up0.att_layer.1.weight", "rv_net_2.up0.att_layer.1.bias", "rv_net_2.up0.att_layer.1.running_mean", "rv_net_2.up0.att_layer.1.running_var", "rv_net_2.up0.att_layer.3.weight", "rv_net_2.up0.att_layer.3.bias", "rv_net_2.up0.conv_high.0.weight", "rv_net_2.up0.conv_high.1.weight", "rv_net_2.up0.conv_high.1.bias", "rv_net_2.up0.conv_high.1.running_mean", "rv_net_2.up0.conv_high.1.running_var", "rv_net_2.up0.conv_low.0.weight", "rv_net_2.up0.conv_low.1.weight", "rv_net_2.up0.conv_low.1.bias", "rv_net_2.up0.conv_low.1.running_mean", "rv_net_2.up0.conv_low.1.running_var". ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 349586) of binary: /home/liuk/anaconda3/envs/cpgnet/bin/python

huixiancheng commented 1 year ago

Hi. It's cause by the mismatch in upsampling stage. You can refer to this PR https://github.com/huixiancheng/No-CPGNet/pull/3 to solve it. By the way, in my personal experiments, results show that grid_smaple from 2x downsample features better than 1x features. Just similar to original Repo.

liukang1811 commented 1 year ago

Hi. It's cause by the mismatch in upsampling stage. You can refer to this PR #3 to solve it. By the way, in my personal experiments, results show that grid_smaple from 2x downsample features better than 1x features. Just similar to original Repo.

thanks, it's fixed