-
-
Notifications
You must be signed in to change notification settings - Fork 650
Make sure metric handlers are fired first #706
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
Comments
@beyondyoni thanks for the ideas. IMO, the order of handlers is up to user to respect. So, if user adds at first the loggers and after that handlers providing the info, it is his/her resposibility. However, I think adding some argument to setup a sort of priority of handlers can be an interesting enhancement ! For instance, I do not know how can we provide such option. If you would like to draft some ideas, please do not hesitate to draft a PR and we can reiterate over. |
I agree with your opinion of order of execution being the user's responsibility but I think the current situation isn't clear enough (I actually came across this bug because a co-worker of asked for my help to solve it). I made a new push. Let's discuss it there |
Okay, I see. Well, let's try to fix this behaviour :)
Could you please make a separate PR for this. Thanks |
@justusschock what do you think about this ? |
I think this is a general question. We should decide, whether we want priorities/sorting of handlers or not (but definitely not support both versions). If we implement it, it should always be used, but this may also introduce unwanted behaviour if some handlers are for example added by an internal function with a different priority, this may also confuse the user, since he might expect some other behaviour. I think, I slightly prefer the way including priorities, but this has to be carefully implemented. |
I think the current design implicitly supports priorities, and is, therefore, a source for (potential) confusion, so I'm glad to see you're leaning towards changing that. If I understand correctly, your implementation approach requires introducing a new Handler class right? I think it's a good idea, as it will also improve areas in the code such as the following:
|
Yes it requires a new handler class but also some code that allows all current handler implementations to continue working by providing good defaults and wrapping possibilities |
Hi,
I noticed that since event handlers are invoked at the order of their insertion, there's a potential bug- if a metric handler is inserted after a TensorBoard handler, the metric value will not be ready at the time of writing.
While this has only minor effects (one epoch shift in the results), I think it can be easily solved by one of two approaches:
add_event_handler
(default would be that metric handlers are inserted with higher priority) and then sort the list whenrun()
is invoked.Let me know if you like any of the ideas, and I'd be happy to draft a PR
The text was updated successfully, but these errors were encountered: