Skip to content

Commit 0e0cf56

Browse files
committed
ignore hparam in eval
1 parent 059ed3d commit 0e0cf56

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

eval.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import torch
12
import logging
23
from pytorch_lightning import Trainer
34
from argparse import ArgumentParser
@@ -8,7 +9,11 @@
89

910
def main(hparams):
1011
# init module
11-
model = AffWild2VA(hparams).load_from_checkpoint(hparams.checkpoint)
12+
model = AffWild2VA(hparams)
13+
# make it easier for us to add new params
14+
checkpoint = torch.load(hparams.checkpoint, map_location=lambda storage, loc: storage)
15+
model.load_state_dict(checkpoint['state_dict'])
16+
print ('Loaded pretrained weights')
1217

1318
trainer = Trainer(
1419
gpus=hparams.gpus,

0 commit comments

Comments
 (0)