open-unmix-pytorch
open-unmix-pytorch copied to clipboard
--help option seems to be broken in v1.2.1
🐛 Bug
Trying to get help information with either -h or --help results in the program crashing with an error message.
To Reproduce
Steps to reproduce the behavior:
(pytorch) C:\Users\Tobias>umx -h
Traceback (most recent call last):
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Tobias\Anaconda3\envs\pytorch\Scripts\umx.exe\__main__.py", line 7, in <module>
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\site-packages\openunmix\cli.py", line 120, in separate
args = parser.parse_args()
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 1768, in parse_args
args, argv = self.parse_known_args(args, namespace)
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 1800, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 2006, in _parse_known_args
start_index = consume_optional(start_index)
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 1946, in consume_optional
take_action(action, args, option_string)
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 1874, in take_action
action(self, namespace, argument_values, option_string)
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 1044, in __call__
parser.print_help()
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 2494, in print_help
self._print_message(self.format_help(), file)
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 2478, in format_help
return formatter.format_help()
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 282, in format_help
help = self._root_section.format_help()
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 213, in format_help
item_help = join([func(*args) for func, args in self.items])
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 213, in <listcomp>
item_help = join([func(*args) for func, args in self.items])
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 213, in format_help
item_help = join([func(*args) for func, args in self.items])
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 213, in <listcomp>
item_help = join([func(*args) for func, args in self.items])
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 529, in _format_action
help_text = self._expand_help(action)
File "C:\Users\Tobias\Anaconda3\envs\pytorch\lib\argparse.py", line 621, in _expand_help
return self._get_help_string(action) % params
TypeError: must be real number, not dict
Expected behavior
Expected behavior would be to just get help displayed. 😅
Environment
Please add some information about your environment
- PyTorch Version (e.g., 1.2): 1.9.0
- OS (e.g., Linux): Windows | Anaconda
- torchaudio loader (y/n):
- Python version: 3.8.12
- CUDA/cuDNN version: 11.1
- Any other relevant information:
thanks, this is known, i will try to fix it next week
I think it is simply fixed by adding a second %-sign to escape the %-character in line 109 of cli.py
"Supported: `['torch', 'asteroid']`. `torch` is ~30%% faster"
good catch, do you want to provide a PR?