Skip to content

Make sure metric handlers are fired first #706

@beyondyoni

Description

@beyondyoni

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:

  1. separating handlers list to two: one for metrics, and the other handler types.
  2. More generic and scalable- allowing users to decide the order of execution by adding priority argument to add_event_handler (default would be that metric handlers are inserted with higher priority) and then sort the list when run() is invoked.

Let me know if you like any of the ideas, and I'd be happy to draft a PR

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions