emotion-gcn icon indicating copy to clipboard operation
emotion-gcn copied to clipboard

load pre-trained model

Open noctilucas1 opened this issue 2 years ago • 1 comments

Sorry for my lack of knowledge...

But, how can I load the model with the pre-trained weights?

noctilucas1 avatar Nov 28 '22 19:11 noctilucas1

Hello @noctilucas1 ,

First, you should download the pre-trained models from here. Then, you have to load the model based on this tutorial.

For example, if you want to load affectnet/emotion_gcn_l2t01p05 you run:

from models import Emotion_GCN

checkpoint = torch.load("affectnet/emotion_gcn_l2t01p05")
model = Emotion_GCN(adj_file="path_to_the_pickle_file", input_size=227)
model.load_state_dict(checkpoint['model_state_dict'])

PanosAntoniadis avatar Nov 30 '22 08:11 PanosAntoniadis