Skip to content

save_params() and load_params() in fluid.io are unavailable #7163

Closed
@JiayiFeng

Description

@JiayiFeng

save_params() and load_params() are used to implement model saving and loading. The model is supposed to be able to continue its training after a saving and loading. However, using save_params() and load_params() cannot satisfy the needs.

The save_params() only save Parameters. But in the Program there are some other critical Variables who are not Parameter, such as optimizers' learning rates and momentums.

The load_params() takes a serialized ProgramDesc protobuf object as its input, and load all Parameters in it. However, there is no such concept of Parameter in the protobuf. All Parameters degrade to normal Variables during flushing into protobuf. Therefore, nothing will be loaded by load_params().

Using save_persistables() and load_persistables_if_exist() seems an avaiable but ungainly substitution.

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