Closed ma7555 closed 3 years ago
Hi, first of all, using model_RawNet2_original_code
is correct :)
I tried to reproduce your situation, but found that the model weight does load well.
After running cp Pre-trained_model/model_RawNet2_original_code.py ./
in python/RawNet2
,
I simply ran the below code and model weights were loaded successfully.
If I recall correctly, there is another closed issue regarding model loading, and at that time I checked that it works. I will try to further look into this issue, but as of now, it seems okay.
import torch
from parser import get_args
from model_RawNet2_original_code import RawNet
args = get_args()
args.model['nb_classes'] = 6112
model = RawNet(args.model, torch.device('cpu'))
model.load_state_dict(torch.load('./Pre-trained_model/rawnet2_best_weights.pt', map_location=torch.device('cpu')))
print('succ')
I am having difficulties loading the pretrained model. tried both model_RawNet2_original_code and model_RawNet2
code with model_RawNet2_original_code
Can you please share a reproducible code for loading the model?