load

paddle.fluid.load(program, model_path, executor=None, var_list=None)[source]

This function get parameters and optimizer information from program, and then get corresponding value from file. An exception will throw if shape or dtype of the parameters is not match.

This function can also load model file saved with [ save_params, save_persistables, save_vars ]. var_list can not be None when load single model file ( filename is not None When save_params, save_persistables or save_vars is called ).

Parameters
  • program (Program) – The program will be loaded

  • model_path (str) – The file prefix store the program

  • executor (Executor, optional) – The executor used for initialize the parameter When startup program is not run.

  • var_list (list, optional) – The variable list to load single model file saved with [ save_params, save_persistables, save_vars ]. Default: None

Returns

None

Examples:
import paddle.fluid as fluid

prog = fluid.default_main_program()
fluid.save( prog, "./temp")

fluid.load( prog, "./temp")