-
Couldn't load subscription status.
- Fork 31k
Closed
Description
Hi,
I tried to fine tune BertForMaskedLM and it works. But i'm facing issues when I try to load the fine tuned model.
Here is the code I used to load the model :
model_state_dict = torch.load("./finetunedmodel/pytorch_model.bin", map_location='cpu')
model_fine = BertForMaskedLM.from_pretrained(pretrained_model_name='bert-base-multilingual-cased', state_dict=model_state_dict, cache_dir='./data')
The error I'm facing is : init() got an unexpected keyword argument 'state_dict'
Does someone already faced this issue ?
Thanks
Edit : I trained my model on gpu and try to use it on cpu. When I use it on gpu it works !
Metadata
Metadata
Assignees
Labels
No labels