pytorch-ZSSR
pytorch-ZSSR copied to clipboard
A small fix for the <config> arguments in Python3
Thanks for the Pytorch implement of ZSSR, it helps me a lot! 👍
Although this project is written in Python2, it still works well for me in Python3. However, when using the <config>
arguments, it will not work. Because the exec()
is a function not a statement now thus the conf
in run_ZSSR_single_input.py can't be updated as expected.
For anyone who wants to use this project in Python3, you could fix this problem by a small change in run_ZSSR_single_input.py.
from:
# Setup configuration and results directory
conf = configs.Config()
if conf_str is not None:
exec ('conf = configs.%s' % conf_str, dic)
conf.result_path = results_path
to:
# Setup configuration and results directory
conf = configs.Config()
if conf_str is not None:
dic={"conf":conf, "configs":configs}
exec ('conf = configs.%s' % conf_str, dic)
conf=dic["conf"]
conf.result_path = results_path