run train.py error
june1819 opened this issue · 7 comments
Dear Dr.Mentzer
I can't run "python train.py -h", but "python test.py -h" works well.
"python train.py -h" error: ValueError: unsupported format character 'O' (0x4f) at index 38. File "train.py", line 125, in
main(sys.argv[1:]) File "train.py", line 91, in main flags = p.parse_args(args)
I can't run "python train.py configs/ms/cr.cf configs/dl/oi.cf log_dir -p upsampling=deconv" to train dataset. but I can run it with "python train.py configs/ms/cr.cf configs/dl/oi.cf log_dir"
Please answer my question
thank you
Hi did you resolve this? It sounds like something goes wrong with encoding?
Dear Dr.Mentzer
first question:“python train.py -h” report error in "/lib/python3.7/argparse.py". I think my python version(3.7.8) is error. What your python concrete version is?(3.7.1 ,3.7.2 or others?)
second question:what "-p upsampling=deconv" means? The train command with "-p upsampling=deconv" reported error "ValueError: Unused params:
- upsampling"
Can you print the complete stack trace of the -h
command? Also, what's your operating system and shell?
And you should be able to train without the -p
flag, that was just to illustrate the config parsing.
-h command:
Traceback (most recent call last):
File "train.py", line 125, in
main(sys.argv[1:])
File "train.py", line 91, in main
flags = p.parse_args(args)
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 1755, in parse_args
args, argv = self.parse_known_args(args, namespace)
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 1787, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 1993, in _parse_known_args
start_index = consume_optional(start_index)
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 1933, in consume_optional
take_action(action, args, option_string)
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 1861, in take_action
action(self, namespace, argument_values, option_string)
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 1043, in call
parser.print_help()
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 2481, in print_help
self._print_message(self.format_help(), file)
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 2465, in format_help
return formatter.format_help()
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 284, in format_help
help = self._root_section.format_help()
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 215, in format_help
item_help = join([func(*args) for func, args in self.items])
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 215, in
item_help = join([func(*args) for func, args in self.items])
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 215, in format_help
item_help = join([func(*args) for func, args in self.items])
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 215, in
item_help = join([func(*args) for func, args in self.items])
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 531, in _format_action
help_text = self._expand_help(action)
File "/home/zsf/anaconda3/envs/l3c_env/lib/python3.7/argparse.py", line 620, in _expand_help
return self._get_help_string(action) % params
ValueError: unsupported format character 'O' (0x4f) at index 38
operating system:Ubuntu. shell: /bin/bash
I can run train command without -p. thanks for explanation
Hey, thanks for the stack trace. Turns out there was a %
in a help message causes this exception. Fixed in latest commit (4ca100e).
Regarding the -p upsampling=deconv
, I cannot reproduce your error message. But I updated the readme to make it a bit more clear that this is not the default command (9133bed)
Thanks for the feedback. Let me know if you find anything else!