wbhu / DnCNN-tensorflow

:octocat::octocat:A tensorflow implement of the paper "Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising"
GNU General Public License v3.0
363 stars 150 forks source link

--use_gpu=False failed #13

Closed sdlpkxd closed 6 years ago

sdlpkxd commented 6 years ago

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 commented 6 years ago

Hi @sdlpkxd ,

plz refer to the updated README.

thanks.

sdlpkxd commented 6 years ago

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 commented 6 years ago

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

wbhu commented 6 years ago

Thanks @sdlpkxd to fix it!