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
I have finetuned layoutlmv2 model using custom dataset which was annotated in FUNSD format. Now i can save my finetuned model in local(.pth) using torch.save. Now i need to get predictions using finetuned (.pth) state dict. Am beginner to this anyone know how to get predictions. .pth has state dict which is weights and biasis.
I tried to get predictions using:
**state_dict = torch.load("/content/model_17.pth")
Create the model and tokenizer using the state dictionary
model = LayoutLMv2ForTokenClassification.from_pretrained("/config.json",state_dict=state_dict, ignore_mismatched_sizes=True)**
but getting weird prediction output. Anybody knew solution for this?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hai,
I have finetuned layoutlmv2 model using custom dataset which was annotated in FUNSD format. Now i can save my finetuned model in local(.pth) using torch.save. Now i need to get predictions using finetuned (.pth) state dict. Am beginner to this anyone know how to get predictions. .pth has state dict which is weights and biasis.
I tried to get predictions using:
**state_dict = torch.load("/content/model_17.pth")
Create the model and tokenizer using the state dictionary
model = LayoutLMv2ForTokenClassification.from_pretrained("/config.json",state_dict=state_dict, ignore_mismatched_sizes=True)**
but getting weird prediction output. Anybody knew solution for this?
Thanks in advance!
The text was updated successfully, but these errors were encountered: