GRAAL-Research / deepparse

Deepparse is a state-of-the-art library for parsing multinational street addresses using deep learning

Home Page:https://deepparse.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RuntimeError: Error(s) in loading state_dict for FastTextSeq2SeqModel

arinzea opened this issue · comments

I am running the example from the docs https://deepparse.org/examples/retrain_with_new_prediction_tags.html.
however the retrain function
address_parser.retrain(training_container, 0.8, epochs=5, batch_size=8, num_workers=2, callbacks=[lr_scheduler], prediction_tags=tag_dictionary, logging_path=logging_path)

is coming up with error:

RuntimeError: Error(s) in loading state_dict for FastTextSeq2SeqModel: size mismatch for decoder.linear.weight: copying a param with shape torch.Size([9, 1024]) from checkpoint, the shape in current model is torch.Size([3, 1024]). size mismatch for decoder.linear.bias: copying a param with shape torch.Size([9]) from checkpoint, the shape in current model is torch.Size([3]).

Hello Arinze,

This is strange. I've just run the example and I was able to retrain the model without issues.

Are you running the last version of deepparse?

If not, could you please upgrade and try again?

Thanks Marouane, it now works with the fixed version 0.4.4.
I have a use case for retraining sample English address data (from AddressBase) and parsing some of the fields.