Solved this error…I was trying to ‘load_state_dict’ on top of putting model to cuda, instead of doing it in two steps.
Fixed snippet:
model = Vgg19()
tnet = Tripletnet(model).cuda()
tnet.load_state_dict(state_dict)
tnet.eval()