Closed Alla-Abdella closed 3 years ago
When using the main.py
script, you can specify the --no_strict
argument. That should fix it. When using main.py
and encountering this error, you should be presented with this message explaining the solution. Since you're not using main.py
, try setting strict=False
like so: model = ExtractiveSummarizer.load_from_checkpoint("../distilroberta-base-ext-sum.ckpt", strict=False)
.
Thank you very much HHousen, the code works for me.
I'm getting this error when I give it the model checkpoint.
Code: model = ExtractiveSummarizer.load_from_checkpoint(path)
error: 2 frames /usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict) 1405 if len(error_msgs) > 0: 1406 raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( -> 1407 self.class.name, "\n\t".join(error_msgs))) 1408 return _IncompatibleKeys(missing_keys, unexpected_keys) 1409
RuntimeError: Error(s) in loading state_dict for ExtractiveSummarizer: Missing key(s) in state_dict: "word_embedding_model.embeddings.position_ids".