SwissArmyTransformer
SwissArmyTransformer copied to clipboard
sat.arguments.get_args failed to handle the "-h" option
What I did
I pass the "-h" option to print the help message.
However, my script complains TypeError: %o format: an integer is required, not dict
in /usr/lib/python3.8/argparse.py:Line633
.
The following snippet can reproduce the phenomenon.
from sat.arguments import get_args
print(get_args(["-h"]))
Suggestion
The following patch works.
diff --git a/sat/arguments.py b/sat/arguments.py
index 5c53bd0..6bfee94 100755
--- a/sat/arguments.py
+++ b/sat/arguments.py
@@ -152,7 +152,7 @@ def add_training_args(parser):
group.add_argument('--lr-decay-ratio', type=float, default=0.1)
group.add_argument('--warmup', type=float, default=0.01,
- help='percentage of data to warmup on (.01 = 1% of all '
+ help='percentage of data to warmup on (.01 = 1%% of all '
'training iters). Default 0.01')
group.add_argument('--weight-decay', type=float, default=0.01,
help='weight decay coefficient for L2 regularization')
Version
The main
branch, c5e09a8bf26b5e95f4ff84f301cf7c8db3db41c2
Welcome pull request directly~