SamYuen101234 / Masked_Face_Recognition

2020/2021 HKUST CSE FYP Masked Facial Recognition, developer: Sam Yuen, Alex Xie, Tony Cheng
https://github.com/SamYuen101234/maskedfacerecognition
MIT License
118 stars 32 forks source link

How to load previous trained model and finetune? #22

Closed tiger990111 closed 2 years ago

tiger990111 commented 2 years ago

Hi dear, I have downloaded the Model1 and tended to finetune it. But it raise error that

Traceback (most recent call last): File "main2.py", line 81, in facenet, optimizer, scheduler = load(name) File "/root/maskedface/Masked_Face_Recognition/train.py", line 26, in load model = checkpoint['model'] TypeError: 'FaceNet2' object is not subscriptable

so how to load your trained model1? And where is the code of finetune?

tiger990111 commented 2 years ago

yeah I find that it's a model file, so just

facenet = torch.load('./models/' + name)

to load it. Don't use load(name).