Skip to content

torch.save() fails when caching specific metrics due to lambda in preprocess #98

@dataymeric

Description

@dataymeric

When caching metrics in eval_multistep, the process crashes for metrics that define a preprocess function as a local lambda (e.g. PowerSpectrum). Python cannot pickle lambda or locally defined functions, leading to a serialization failure during torch.save.

AttributeError: Can't get local object '<Class>.__init__.<locals>.<lambda>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions