Skip to content

Saving ReduceLROnPlateau crashes #5218

@jlquinn

Description

@jlquinn

I'm working on checkpointing in our nn trainer. When saving the state objects, I get an error:

PicklingError: Can't pickle <type 'function'>: attribute lookup builtin.function failed

I tracked it down to trying to save the scheduler ReduceLROnPlateau. I think the issue is due to the scheduler referencing the optimizer, which has to be saved with state_dict(). I presume the same error will occur with other schedulers too.

It seems like the problem could be solved by providing a state_dict() and load_state_dict() in the scheduler classes.

pytorch master rev a544071 (Jan 22)
installed from source
x86_64 on centos 7.4
cuda 9.0 cudnn 7
k80
gcc 5.4
python 2.7.14

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