Closed tzhang10 closed 3 weeks ago
This error arises because an.load_args(log_dirs)
tries to read the training arguments, which were saved in a text file during training, and re-parse using argparse. The problem is the random seed arguments are specified as type int
, but the value None
is read in from the text file as a string.
I believe this fix should work, but I have not tested it.
First, define a new function int_or_none
:
def int_or_none(value):
if value == "None":
return None
return int(value)
Then, specify this function as the type
for the argparse arguments:
parser.add_argument("--py_rseed",
help="random seed for python, set just before training begins at the top of run_training()",
type=int_or_none,
default=None)
Let me know if that works!
Thanks so much for the help! It works!
To run the model without specific random seeds, I modify parse_reg_args.py by changing the default value in the line 114~127 from 7 to None. It successfully generated different outputs, however, when I call the
load_args()
method from analysis.py, this error message showed up: Code changed part:input:
Error message:
Could you please give me some insights on how to solve this issue?