I tired to save sub model in seq-to-seq model which is encoder part.
What I used for save and load is like follow code and I failed with error like title.
* Failed case
* error message
AttributeError: 'LSTM' object has no attribute 'seek'. You can only torch.load from a file that is seekable. Please pre-load the data into a buffer like io.BytesIO and try to load from it instead.
My solution is to use 'state_dict()' to save model.
Refer to bellow code which was solution for me.
Post a Comment