`save_params()` and `load_params()` in `fluid.io` are unavailable
Created by: 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 Variable
s 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 Parameter
s degrade to normal Variable
s 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.