Skip to content

[Error] Model save error when including lr_scheduler #6

@FacerAin

Description

@FacerAin

Model save error when including lr_scheduler like this
Can‘t pickle local object‘get_linear_schedule_with_warmup’\<locals\> lr_lamda‘

You can solve this error to add dill library like this

import dill  
...  
torch.save(model, "model.pt", pickle_module=dill)  

referenced by: https://blog.csdn.net/qq_37747189/article/details/117700335

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions