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:
parent
e865b046b1
commit
1a9f1c80a1
|
@ -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':
|
||||
|
|
Loading…
Reference in New Issue