Closed miraclebiu closed 7 years ago
and small difference in load model in example/tripletloss.py in args.resume use model.load_state_dict() while in the end of the train use model.module.load_state_dict()
@miraclebiu Thank you very much for the suggestions!
Line 99 is indeed a hacking that generates the net structure avgpool -> FC(1024) -> FC(args.features), which follows the setting in this paper.
Using model.load_state_dict()
here in args.resume
is because the model is not yet wrapped by nn.DataParallel
. While in the end the model is wrapped by it, so we need to call model.module.load_state_dict()
.
Line 99 in example/tripletloss.py num_classes should be the value above rather than args.num_features