mmengine
mmengine copied to clipboard
[Feature] Customize the log directory name
What is the feature?
Hi. I have a question about the log_dir of the Runner always being fixed. It's always a timestamp, and I'd like to see a way to customize this.
Currently, this uses work_dir/timestamp as shown below, but it would be nice to be able to use other names instead of timestamp for convenience. https://github.com/open-mmlab/mmengine/blob/45ee96d0c4643bafcc64f94e761a65159ef31083/mmengine/runner/runner.py#L369
I don't think it's that hard, what do you all think? and also I try that could just replace the _log_dir in the runner and recreate the log_dir, but that would create an empty folder since it's already been created within init. So I'm looking for a clean way to do this without creating empty folders.
Any other context?
No response
Hi @harimkang , thank you for your feedback. It's a great suggestion. I think we can pass it through the cfg
parameters. Here's an example below.
self._log_dir = osp.join(self.work_dir, cfg.get('log_dir', self.timestamp))
If you approve of the above approach, would you be willing to submit a pull request to support it?
Hi @harimkang , thank you for your feedback. It's a great suggestion. I think we can pass it through the
cfg
parameters. Here's an example below.self._log_dir = osp.join(self.work_dir, cfg.get('log_dir', self.timestamp))
If you approve of the above approach, would you be willing to submit a pull request to support it?
I like it. Thank you for quick response.