PersFormer_3DLane icon indicating copy to clipboard operation
PersFormer_3DLane copied to clipboard

Model weight loading error

Open WYL-Projects opened this issue 3 years ago • 1 comments

We used the best trained model provided in the article for testing, but the weight of the model was loaded incorrectly. The reason seems to be that the keys of the model parameters don't match, that is, the model parameters don't match. However, the hyperparameters I used have always been the hyperparameters in the code and haven't been changed. The error results are as follows: 图片

WYL-Projects avatar May 12 '22 07:05 WYL-Projects

We update the model code and corresponding checkpoint, so you need to download the newest file from here.

dyfcalid avatar May 13 '22 05:05 dyfcalid

Hi @dyfcalid , I used your weights and the size is mismatched:

Exception has occurred: RuntimeError
Error(s) in loading state_dict for PersFormer:
	size mismatch for laneatt_head.attention_layer.weight: copying a param with shape torch.Size([111, 1408]) from checkpoint, the shape in current model is torch.Size([2783, 1408]).
	size mismatch for laneatt_head.attention_layer.bias: copying a param with shape torch.Size([111]) from checkpoint, the shape in current model is torch.Size([2783]).
  File "/home/derek/PersFormer_3DLane/experiments/runner.py", line 502, in eval
    model.load_state_dict(checkpoint['state_dict'])
  File "/home/derek/PersFormer_3DLane/main_persformer.py", line 39, in main
    runner.eval()
  File "/home/derek/PersFormer_3DLane/main_persformer.py", line 43, in <module>
    main()

callzhang avatar Aug 24 '22 10:08 callzhang

@callzhang Please see the related issue above. This checkpoint is outdated and we are not allowed to provide a pretrained model.

ilnehc avatar Aug 24 '22 10:08 ilnehc

Hi @dyfcalid , I used your weights and the size is mismatched:

Exception has occurred: RuntimeError
Error(s) in loading state_dict for PersFormer:
	size mismatch for laneatt_head.attention_layer.weight: copying a param with shape torch.Size([111, 1408]) from checkpoint, the shape in current model is torch.Size([2783, 1408]).
	size mismatch for laneatt_head.attention_layer.bias: copying a param with shape torch.Size([111]) from checkpoint, the shape in current model is torch.Size([2783]).
  File "/home/derek/PersFormer_3DLane/experiments/runner.py", line 502, in eval
    model.load_state_dict(checkpoint['state_dict'])
  File "/home/derek/PersFormer_3DLane/main_persformer.py", line 39, in main
    runner.eval()
  File "/home/derek/PersFormer_3DLane/main_persformer.py", line 43, in <module>
    main()

Hello, I meet same problem with you, when I want to test PersFormer by my own dataset. And I try to use provided best model, the error is same. Do you solve this problem?

PeterJaq avatar Dec 12 '22 07:12 PeterJaq