Closed HanGuangXin closed 1 year ago
Officially implemented resnet or other models, you need to make a little modification to extract the embedding features. As follows:
def forward_impl(self, x: Tensor, embed):
...
...
x = self.avgpool(x)
emb_fea = torch.flatten(x, 1)
logits = self.fc(emb_fea)
if embed:
return emb_fea, logits
else:
return logits
Yes, I guess so.
File "train_kd.py", line 331, in train t_emb, t_logits = teacher(images) ValueError: too many values to unpack (expected 2)