Bug in the optim.py
tianyu-z opened this issue · 0 comments
tianyu-z commented
After updating to the latest master, I got this:
Traceback (most recent call last):
File "train.py", line 199, in <module>
main()
File "/home/mila/t/tianyu.zhang/myenv/lib/python3.7/site-packages/hydra/main.py", line 24, in decorated_main
strict=strict,
File "/home/mila/t/tianyu.zhang/myenv/lib/python3.7/site-packages/hydra/_internal/utils.py", line 174, in run_hydra
overrides=args.overrides,
File "/home/mila/t/tianyu.zhang/myenv/lib/python3.7/site-packages/hydra/_internal/hydra.py", line 86, in run
job_subdir_key=None,
File "/home/mila/t/tianyu.zhang/myenv/lib/python3.7/site-packages/hydra/plugins/common/utils.py", line 109, in run_job
ret.return_value = task_function(task_cfg)
File "train.py", line 175, in main
trainer.setup()
File "/home/mila/t/tianyu.zhang/omnigan/omnigan/trainer.py", line 252, in setup
self.G, self.opts.gen.opt, self.opts.tasks
File "/home/mila/t/tianyu.zhang/omnigan/omnigan/optim.py", line 72, in get_optimizer
elif len(opt_conf.lr) == 1: # Use default for all tasks
TypeError: object of type 'float' has no len()
I get back to opts.gen.opt.lr in defaults.yaml and I find it is indeed a float: 0.00001
I suggest we check the type of opt_conf.lr before len(opt_conf.lr) or we change the defaults.yaml.