Pytorch_Realtime_Multi-Person_Pose_Estimation icon indicating copy to clipboard operation
Pytorch_Realtime_Multi-Person_Pose_Estimation copied to clipboard

I think there are bugs in train_pose.py

Open ghost opened this issue 6 years ago • 6 comments

Hi,

I ran train.sh, but I had some errors. I think there are bugs.

Should I add "input = input.cuda()" to around line 138 in train_pose.py and change line 63 "params_dict = dict(model.module.named_parameters())" in train_pose.py to "params_dict = dict(model.named_parameters())" .

ghost avatar Dec 14 '17 09:12 ghost

If you use one gpu to train and change line 49 "model = torch.nn.DataParallel(model, device_ids=args.gpu).cuda()" to "model = model.cuda()", you're right. Because of torch.nn.DataParallel, it will change "model" to "model.module" and it's the reason that when run test, I will use k[7:] to get the key. If you use the one gpu, you also need to change the test script

last-one avatar Dec 14 '17 12:12 last-one

Thank you for your replying.

Yes, I use one gpu to train. Should I change other codes ?

ghost avatar Dec 14 '17 13:12 ghost

No, I think. If you find something error, please let me know. Thank you.

last-one avatar Dec 14 '17 13:12 last-one

Thank you !

ghost avatar Dec 14 '17 13:12 ghost

@tugumi911 you are right! if one gpu is used, "input = input.cuda()" and "params_dict = dict(model.named_parameters())" should be modified! thanks

xdxuefei avatar Mar 09 '18 02:03 xdxuefei

If we want to use only one GPU, there is another way can achieve it.

  1. Remove the line "os.environ['CUDA_VISIBLE_DEVICES'] = '2,3'" in the train_pose.py.
  2. Modify the value of --gpu in train.sh to 0.

bandontseng avatar Mar 16 '18 01:03 bandontseng