mmengine icon indicating copy to clipboard operation
mmengine copied to clipboard

[Feature] Customize the log directory name

Open harimkang opened this issue 1 year ago • 2 comments

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

harimkang avatar Sep 08 '23 00:09 harimkang

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?

zhouzaida avatar Sep 08 '23 15:09 zhouzaida

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.

harimkang avatar Sep 09 '23 02:09 harimkang