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

--use_gpu=False failed #13

Closed
sdlpkxd opened this issue Nov 8, 2017 · 4 comments
Closed

--use_gpu=False failed #13

sdlpkxd opened this issue Nov 8, 2017 · 4 comments
Labels

Comments

@sdlpkxd
Copy link
Contributor

sdlpkxd commented Nov 8, 2017

I try to run your code without GPU using the flowing commands:

python main.py --phase=test --use_gpu=False

But it prints "GPU" and “[!] Load failed...", I think it should print "CPU". Can the type of bool be used in parser.add_argument()? I don't think so.
You can refer to https://stackoverflow.com/questions/15008758/parsing-boolean-values-with-argparse

@wbhu
Copy link
Owner

wbhu commented Nov 8, 2017

Hi @sdlpkxd ,

plz refer to the updated README.

thanks.

@sdlpkxd
Copy link
Contributor Author

sdlpkxd commented Nov 8, 2017

When you use argparse to parse boolean command-line arguments, it doesn't work. In you code "parser.add_argument('--use_gpu', dest='use_gpu', type=bool, default=True, help='gpu flag')" in main.py, type=bool maybe Inappropriate. I can not change the work mode to CPU by "python main.py --phase test --use_gpu False". You can refer to this.

thank you

@wbhu wbhu added the bug label Nov 9, 2017
@wbhu wbhu mentioned this issue Nov 9, 2017
@wbhu
Copy link
Owner

wbhu commented Nov 9, 2017

Yeah, it is a bug, waiting to be fixed.

wbhu pushed a commit that referenced this issue Nov 13, 2017
@wbhu
Copy link
Owner

wbhu commented Nov 13, 2017

Thanks @sdlpkxd to fix it!

@wbhu wbhu closed this as completed Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants