Open tonyhuang33 opened 2 years ago
I trained with CustomCLIPWrapper, and successfully loaded checkpoints. Here my code for this
img_encoder = resnet50(pretrained=False)
img_encoder.fc = torch.nn.Linear(2048, 768)
txt_encoder = AutoModel.from_pretrained("vinai/phobert-base")
model = CustomCLIPWrapper(img_encoder, txt_encoder, 64, avg_word_embs=True)
checkpoint = torch.load(ckpt_path)
model.load_state_dict(checkpoint["state_dict"])
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
I have some problems about how to load checkpoing with Customwrapped. Could give some code example to me? I would be very grateful to you