You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When usingExtractiveSummarizer.load_from_checkpointor ExtractiveSummarizer.load_weights to load most of the models, i find that the position_ids field is not saved in the checkpoint file, which causes an error. The only model that can be correctly loaded is distilbert-base-uncased-ext-sum
This is the error I get when running predictions_website.py and trying to use bert-base-uncased-ext-sum checkpoints.
Exception happened during processing of request from ('127.0.0.1', 34450)
Traceback (most recent call last):
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/socketserver.py", line 320, in _handle_request_noblock
self.process_request(request, client_address)
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/socketserver.py", line 351, in process_request
self.finish_request(request, client_address)
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/socketserver.py", line 364, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/socketserver.py", line 724, in __init__
self.handle()
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/http/server.py", line 418, in handle
self.handle_one_request()
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/http/server.py", line 406, in handle_one_request
method()
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/site-packages/gradio/networking.py", line 158, in do_POST
prediction, durations = interface.process(raw_input)
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/site-packages/gradio/interface.py", line 220, in process
prediction = predict_fn(*processed_input)
File "/home/myuser/intrical/repos/Intrical-Transformers/predictions_website.py", line 11, in summarize_text
summarizer = ExtractiveSummarizer.load_from_checkpoint(model_choice)
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/site-packages/pytorch_lightning/core/saving.py", line 153, in load_from_checkpoint
model = cls._load_model_state(checkpoint, *args, strict=strict, **kwargs)
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/site-packages/pytorch_lightning/core/saving.py", line 192, in _load_model_state
model.load_state_dict(checkpoint['state_dict'], strict=strict)
File "/home/myuser/anaconda3/envs/transformersum/lib/python3.6/site-packages/torch/nn/modules/module.py", line 1045, in load_state_dict
self.__class__.__name__, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for ExtractiveSummarizer:
Missing key(s) in state_dict: "word_embedding_model.embeddings.position_ids".
----------------------------------------
How can I correctly load any type of model?
The text was updated successfully, but these errors were encountered:
@gabriele-bani Good catch. This is a problem with the update from 3.0.2 to 3.1.0 of huggingface/transformers. The problem is being discussed at huggingface/transformers#6882. While they work on a fix, you can install the previous version of huggingface/transformers by running pip install -U transformers==3.0.2. Let me know if this solves the problem for you.
When using
ExtractiveSummarizer.load_from_checkpoint
orExtractiveSummarizer.load_weights
to load most of the models, i find that theposition_ids
field is not saved in the checkpoint file, which causes an error. The only model that can be correctly loaded isdistilbert-base-uncased-ext-sum
This is the error I get when running
predictions_website.py
and trying to usebert-base-uncased-ext-sum
checkpoints.How can I correctly load any type of model?
The text was updated successfully, but these errors were encountered: