HorizonNet icon indicating copy to clipboard operation
HorizonNet copied to clipboard

is there some model adjustment in it?

Open ayj12345 opened this issue 5 years ago • 8 comments

RuntimeError: Error(s) in loading state_dict for HorizonNet: Missing key(s) in state_dict: "feature_extractor.encoder.conv1.1.weight", "feature_extractor.encoder.bn1.weight", "feature_extractor.encoder.bn1.bias", "feature_extractor.encoder.bn1.running_mean", "feature_extractor.encoder.bn1.running_var", "feature_extractor.encoder.layer1.0.conv1.weight", "feature_extractor.encoder.layer1.0.bn1.weight", "feature_extractor.encoder.layer1.0.bn1.bias", "feature_extractor.encoder.layer1.0.bn1.running_mean", "feature_extractor.encoder.layer1.0.bn1.running_var", "feature_extractor.encoder.layer1.0.conv2.1.weight", "feature_extractor.encoder.layer1.0.bn2.weight", "feature_extractor.encoder.layer1.0.bn2.bias", "feature_extractor.encoder.layer1.0.bn2.running_mean", "feature_extractor.encoder.layer1.0.bn2.running_var", ... Unexpected key(s) in state_dict: "stage1.0.layer.1.weight", "stage1.0.layer.1.bias", "stage1.0.layer.2.weight", "stage1.0.layer.2.bias", "stage1.0.layer.2.running_mean", "stage1.0.layer.2.running_var", "stage1.0.layer.2.num_batches_tracked", "stage1.0.layer.5.weight", "stage1.0.layer.5.bias", "stage1.0.layer.6.weight", "stage1.0.layer.6.bias", "stage1.0.layer.6.running_mean", "stage1.0.layer.6.running_var", "stage1.0.layer.6.num_batches_tracked", "stage1.0.layer.9.weight", "stage1.0.layer.9.bias", ...

ayj12345 avatar Aug 23 '19 01:08 ayj12345

I added strict=False attribute to load_state_dict(). But the demo not work well. net.load_state_dict(state_dict['state_dict'], strict=False)`

ayj12345 avatar Aug 23 '19 03:08 ayj12345

Hi, I have updated the code a lot which causes the key mismatch between current implementation and the original trained one. I'm going to train again and release the new weight by this week.

sunset1995 avatar Aug 23 '19 04:08 sunset1995

The strict=False doesn't work is expected as it will be just random initialization.

sunset1995 avatar Aug 23 '19 04:08 sunset1995

Hi, I have updated the code a lot which causes the key mismatch between current implementation and the original trained one. I'm going to train again and release the new weight by this week.

Thank you for your prompt reply. This interesting work is great helpful for me!

ayj12345 avatar Aug 23 '19 05:08 ayj12345

Got the same issue on Missing key(s) in state_dict. Look forward to the update. Thank you.

robbiedood avatar Aug 26 '19 02:08 robbiedood

Sorry, I'm super busy now 😭 A few more days plz.

sunset1995 avatar Aug 26 '19 06:08 sunset1995

I have just updated. list of pretrained model

sunset1995 avatar Aug 27 '19 13:08 sunset1995

The issue has been resolved after the update. Brilliant, thank you !

robbiedood avatar Aug 28 '19 00:08 robbiedood