Skip to content

Conversation

@hhadian
Copy link
Contributor

@hhadian hhadian commented Mar 17, 2018

@danpovey, could you please see if this is how you meant for this to be done?
If yes, I'll make changes to the rest of the nnet3 scripts.

run_opts = common_train_lib.RunOpts()
if args.use_gpu:
if args.use_gpu in ["true", "false"]:
args.use_gpu = {'true': 'yes', 'false': 'no'}[args.use_gpu]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if you wrote this as
args.gpu = ("yes" if args.gpu == "true" else "no")
as it's easier for a human to parse.
Otherwise this is OK.

action=common_lib.StrToBoolAction,
choices=["true", "false"],
help="Use GPU for training", default=True)
choices=["true", "false", "yes", "no", "wait"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should probably mention that "true" and "false" are deprecated.

@danpovey
Copy link
Contributor

Thanks-- merging.

@danpovey danpovey merged commit df9d16c into kaldi-asr:master Mar 18, 2018
LvHang pushed a commit to LvHang/kaldi that referenced this pull request Apr 14, 2018
Skaiste pushed a commit to Skaiste/idlak that referenced this pull request Sep 26, 2018
@hhadian hhadian deleted the gpu_wait branch October 4, 2018 16:17
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

Successfully merging this pull request may close these issues.

2 participants