Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I think there are bugs in train_pose.py #10

Open
ghost opened this issue Dec 14, 2017 · 6 comments
Open

I think there are bugs in train_pose.py #10

ghost opened this issue Dec 14, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Dec 14, 2017

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())" .

@last-one
Copy link
Owner

last-one commented Dec 14, 2017

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

@ghost
Copy link
Author

ghost commented Dec 14, 2017

Thank you for your replying.

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

@last-one
Copy link
Owner

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

@ghost
Copy link
Author

ghost commented Dec 14, 2017

Thank you !

@xdxuefei
Copy link

xdxuefei commented Mar 9, 2018

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

@bandontseng
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants