8000 Metrics are not pickleable · Issue #47 · netrack/keras-metrics · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Metrics are not pickleable #47
Open
@chrissype

Description

@chrissype

Instantiated metrics are not pickleable, as __init__ instantiates tf variables, which cannot be pickled.

This means that keras models trained with one of the metrics, and then saved, cannot be opened without knowing the dict structure for the 'custom_objects' argument when loading the model. Without using dill, one cannot pickle said dict, which would make delivering a complete model possible. Tools like mlflow are able to track and return complete keras models, however only if the model and custom_objects are both pickleable.

I've come up with a moderately ugly solution that waits until a metric is called to instantiate any tf variables, let me know if you want to see it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0