Person_reID_baseline_pytorch icon indicating copy to clipboard operation
Person_reID_baseline_pytorch copied to clipboard

RuntimeError: Error(s) in loading state_dict for ft_net #25

Open jhq1234 opened this issue 3 years ago • 1 comments

Desktop (please complete the following information):

  • OS: ubuntu 20.04
  • Browser firefox
  • Version [e.g. 22]

Hi, I'm new in the person-Reid and thank you for making a good code sample I got this error when I test the Resnet50 with triplet-loss on Market-1501 And I find that when I trained and tested normal person re-id task (not using triplet loss) with nn.DataParallel for using multi GPU at training time, the error has occurred. image The model was trained well during 180m but when I implement the code 'python test.py --gpu_ids 0 --name ft_ResNet50 --test_dir MY_DATA_PATH --which_epoch 59' for testing the model, I got a problem

How can I solve this problem?

jhq1234 avatar Jul 20 '21 01:07 jhq1234

Hi @jhq1234 If you use multiple gpus, you need to make the model as DataParallel in the test.py as well before loading it.

layumi avatar Jul 21 '21 16:07 layumi