Open DaddyWesker opened 3 years ago
Well, i've looked on the train_attention_rank_loss.py
and have found how to load model. So, i'm loading it like this now
model = resnet18(end2end=True)
model = torch.nn.DataParallel(model).cuda()
checkpoint = torch.load('/home/SingularityNet/EmotionRecognition/Challenge-condition-FER-dataset/ijba_res18_naive.pth.tar')
pretrained_state_dict = checkpoint['state_dict']
model_state_dict = model.state_dict()
for key in pretrained_state_dict:
if ((key == 'module.fc.weight') | (key == 'module.fc.bias')):
pass
else:
model_state_dict[key] = pretrained_state_dict[key]
model.load_state_dict(model_state_dict, strict=False)
model.eval()
If i got it right, i need then send 6 concatenated images to the model. And it should be images of different cropped parts of the one image. SHould they (parts) be random crops? Also, what is the image_size? I've got images 640x480 and, if i got it right, resulting tensor in my case should be [1, 3, 480, 640, 6]? Or something else?
Can you send the problem to my gmail? @.***
DaddyWesker @.***>于2021年7月27日 周二下午4:43写道:
Well, i've looked on the train_attention_rank_loss.py and have found how to load model. So, i'm loading it like this now
model = resnet18(end2end=True) model = torch.nn.DataParallel(model).cuda() checkpoint = torch.load('/home/SingularityNet/EmotionRecognition/Challenge-condition-FER-dataset/ijba_res18_naive.pth.tar') pretrained_state_dict = checkpoint['state_dict'] model_state_dict = model.state_dict() for key in pretrained_state_dict: if ((key == 'module.fc.weight') | (key == 'module.fc.bias')): pass else: model_state_dict[key] = pretrained_state_dict[key] model.load_state_dict(model_state_dict, strict=False) model.eval()
If i got it right, i need then send 6 concatenated images to the model. And it should be images of different cropped parts of the one image. SHould they (parts) be random crops? Also, what is the image_size? I've got images 640x480 and, if i got it right, resulting tensor in my case should be [1, 3, 480, 640, 6]? Or something else?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kaiwang960112/Challenge-condition-FER-dataset/issues/41#issuecomment-887328429, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6LK4B7KRTZNF5NF4CBEITTZZWU5ANCNFSM5A7NPT3Q .
@kaiwang960112 What is your gmail? And what should i send? Just everything i've stated here or something else?
Yes my email is @.***
DaddyWesker @.***>于2021年7月27日 周二下午5:49写道:
@kaiwang960112 https://github.com/kaiwang960112 What is your gmail? And what should i send? Just everything i've stated here or something else?
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/kaiwang960112/Challenge-condition-FER-dataset/issues/41#issuecomment-887372726, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6LK4FQFDFTN4J3GL3LDFLTZZ6LHANCNFSM5A7NPT3Q .
@kaiwang960112 "Yes my email is @ . " I'm seeing only symbol instead of gmail.
Hello.
THanks for your code. I've tried to use your uploaded model "ijba_res18_naive.pth.tar" to infer using script FERplus_dir/test_rank_loss_attention.py, but i've got error on the line
model.load_state_dict(checkpoint['state_dict'])
Here is the error
Probably i'm doing something wrong and this file "ijba_res18_naive.pth.tar" should be used somewhere else. Will be glad to hear some advises.