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.
This commit is contained in:
Ryan Henderson 2020-05-04 17:40:50 +02:00 committed by GitHub
parent e865b046b1
commit 1a9f1c80a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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':