dnadna train --overwrite bugs
Running dnadna train config.yml --overwrite
just create a new run directory, instead of overwriting the last one.
Actually, it works if one use dnadna train config.yml --overwrite -r run_001` (it overwrites the run_001).
But changing in the config file run_name_format with run_001 (instead of run_{run_id} (or trying with run_name or run_id), does not do anything (leads to an error in the first case).
Using the --debug
flag actually raise an error when using -r run_001
:
2022-05-15 12:59:11; ERROR; AttributeError: run_id
Traceback (most recent call last):
File "/home/tau/jcury/DNADNA_project/dnadna/dnadna/utils/config.py", line 1347, in __getattr__
return getattr(self, self.config_attr)[attr]
File "/home/tau/jcury/DNADNA_project/dnadna/dnadna/utils/config.py", line 1013, in __getitem__
value = super().__getitem__(key)
File "/home/tau/jcury/DNADNA_project/dnadna/dnadna/utils/config.py", line 436, in __getitem__
raise KeyError(key)
KeyError: 'run_id'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tau/jcury/DNADNA_project/dnadna/dnadna/utils/cli.py", line 254, in main
ret = cls.run(args)
File "/home/tau/jcury/DNADNA_project/dnadna/dnadna/cli/train.py", line 53, in run
model_trainer.ensure_run_dir(run_id, args.overwrite)
File "/home/tau/jcury/DNADNA_project/dnadna/dnadna/training.py", line 1053, in ensure_run_dir
f'the specified run ID {self.run_id} already exists under '
File "/home/tau/jcury/DNADNA_project/dnadna/dnadna/utils/config.py", line 1349, in __getattr__
raise AttributeError(attr)
AttributeError: run_id
So, a few things should be fixed here:
- make it clearer (doc, help) that
--overwrite
works in conjunction with-r
- fix aforementioned bug with the
--debug
flag - allows to overwrite last run when using
--overwrite
only