From 1a9f1c80a131cde9dea395081f16e0222df31593 Mon Sep 17 00:00:00 2001 From: Ryan Henderson Date: Mon, 4 May 2020 17:40:50 +0200 Subject: [PATCH] Fix example argument parser in docs (#1692) [`parser.parse_known_args()`](https://docs.python.org/3.7/library/argparse.html#argparse.ArgumentParser.parse_known_args) actually returns a tuple of the Namespace of known args and a list of unknown args. We only want the former. --- docs/source/hyperparameters.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/hyperparameters.rst b/docs/source/hyperparameters.rst index ff067b82e0..a1364b5084 100644 --- a/docs/source/hyperparameters.rst +++ b/docs/source/hyperparameters.rst @@ -213,7 +213,7 @@ Now we can allow each model to inject the arguments it needs in the main.py parser.add_argument('--model_name', type=str, default='gan', help='gan or mnist') # THIS LINE IS KEY TO PULL THE MODEL NAME - temp_args = parser.parse_known_args() + temp_args, _ = parser.parse_known_args() # let the model add what it wants if temp_args.model_name == 'gan':