-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
Hi!
It is very exciting work!
But there are same issues happen:
I want to test the performance of classification of events. So I use MatchVision_Classifier and then load the classifier checkpoint,modify the names of key. But in the end the output shape is not correct.
from model.MatchVision_classifier import MatchVision_Classifier
import torch
classifier = MatchVision_Classifier()
checkpoint = torch.load("weights/pretrained_classification.pth",map_location='cpu')
new_static_dict = {key.replace("module.", ""): value for key, value in checkpoint['state_dict'].items()}
classifier.load_state_dict(new_static_dict,strict=False)run error as shown:
RuntimeError: Error(s) in loading state_dict for MatchVision_Classifier:
size mismatch for classifier.weight: copying a param with shape torch.Size([23, 768]) from checkpoint, the shape in current model is torch.Size([24, 768]).
size mismatch for classifier.bias: copying a param with shape torch.Size([23]) from checkpoint, the shape in current model is torch.Size([24]).how to infer the classifier model?
Metadata
Metadata
Assignees
Labels
No labels