0

I'd like to use the pruned model and weight but, whenever I load the model or weight, this error messages keep popping up... My weight and model's files:

enter image description here

Error messages

enter image description here

Ivan
  • 34,531
  • 8
  • 55
  • 100
Joanne
  • 3
  • 2

1 Answers1

0

The reason why you have this error is that some weights present in the file you are trying to load have no corresponding parts in the initialized model (since it has been pruned). One quick way to go around that is to silent the warnings with the strict=False option:

model.load_state_dict(state_dict, strict=False)

You can actually store the result of that call and log the missing and unexpected modules found in the file.

Ivan
  • 34,531
  • 8
  • 55
  • 100