-
Notifications
You must be signed in to change notification settings - Fork 323
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] add auto_step flag in WandbVisBackend #1072
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution. The overall modification LGTM 😄 .
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
@HAOCHENYE Thank you for your review. |
New in version 0.7.3 | ||
|
||
Note: | ||
If ``auto_step`` is False, ``log_metric_by_epoch`` in :cls:`mmengine.hook.LoggerHook` needs to be set to ``False`` too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a line break here.
Sorry, I am reconsidering this PR because my first version is not user-friendly. In my first version, the |
Hi @i-aki-y , the idea your proposed above looks good to me. |
@zhouzaida @HAOCHENYE I revised the PR, I would appreciate it if you review it. As I answered @zhouzaida's comment, I introduced the I still left the |
Hi! The modification makes sense to me. Refers to wandb/wandb#2642 and https://docs.wandb.ai/ref/python/run#define_metric, I found that WandB can support logging data on different x axis like that: import wandb
# 1. Start a W&B run
wandb.init(project='test')
# 2. Save model inputs and hyperparameters
config = wandb.config
config.learning_rate = 0.01
wandb.define_metric('loss1', step_metric='iter', step_sync=False)
wandb.define_metric('loss2', step_metric='epoch', step_sync=False)
# Model training code here ...
# 3. Log metrics over time to visualize performance
for i in range(100):
wandb.log({"loss1": i, 'iter': i})
if i % 10 == 0:
wandb.log({"loss2": i, 'epoch': i // 10})
wandb.log({"loss3": i * 10, 'epoch': i // 10}) Will this make it possible to record epoch-based data? |
@HAOCHENYE Thank you for pointing interesting feature. It looks to work as expected! Unfortunately, the current |
I think this kind of modification The mmengine/mmengine/runner/log_processor.py Line 182 in be347df
Maybe the |
@HAOCHENYE thank you for the advice. I think we should allow setting multiple define_metrics in the cfg. I think the following usage:
|
@HAOCHENYE @zhouzaida Since the solution that uses define_metric is based on a different idea and the implementation is also different, I made a separate PR (#1099). If the new solution is better I will close this issue. |
Hi, we can re-define the existing |
The solution in #1099 seems like a more elegant solution so we can close this PR. Thanks for your contribution very much. |
I think PR (#1099) is a better solution, so I am closing this PR |
Motivation
The wandb backend uses a mechanism of the auto-increment built in the
wandb.log
.But this step information will be reset to zero after the resumption.
So when I resume the training, I get the following discontinuous graph.
This behavior is a little confusing, I think the graphs should be continuous before and after the resumption.
Modification
To fix this, I added an
auto_step
flag that allows the user to select the increment method.BC-breaking (Optional)
No. Default auto_step is set to True which is consistent with the current behavior.
Use cases (Optional)
This makes wandb graph natural before and after the resumption (like the second image above).
Checklist