load

Note: This API is only avaliable in [Static Graph] mode

paddle.fluid.load(program, model_path)[source]

This function filter out 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 between program and loaded file.

NOTICE: This function MUST called after run start_up_program

Parameters
  • program – The program to be load

  • model_path – The file prefix store the program

Returns

None

Examples:
import paddle.fluid as fluid

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

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