-
Notifications
You must be signed in to change notification settings - Fork 898
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
[BUG] Uncomplete metrics on callback since darts 0.30 (everything still works with darts 0.29) #2637
Comments
Hi @MarcBresson and thanks for raising this issue. Indeed, this was introduced in #2391, where we added support for stateful metrics (e.g. cache metric results per batch and then aggregate only at the end of the epoch). The problem is that the Callback hook So ultimately, in the callback, you currently only have access to metrics of the last epoch. I can investigate if there is a way to compute the metrics before the callback hook. But the current implementation is actually based on what Anyways, you can fix this in your Callback by computing the metrics on the go.
It will raise a warning when performing sanity checks (first validation run) where the train metrics have not been updated. This is expected and not a problem (can also be fixed with some more lines of code). |
Thank you for your quick answer :) I'll do what you suggested. It has been almost two years since I contributed to torchmetrics, so I may be a bit rusty on that matter. After going through their source code (both of pytorch-lightning and torchmetrics), I have one more question:
|
That is true, and a bit worrying. Might be worth contacting |
Describe the bug
On the first callback
on_validation_epoch_end
oron_train_epoch_end
, no metric given in torch_metrics is available.To Reproduce
Expected behavior
In darts 0.29, it was giving all the metrics right away:
but on darts 0.30, metrics are missing
as you can see, on val 0 I don't have any metrics, but on train 0 I have all the validation metrics (but no training metrics)
System (please complete the following information):
The text was updated successfully, but these errors were encountered: