load_persistables¶
- paddle.fluid.io. load_persistables ( executor, dirname, main_program=None, filename=None ) [source]
- 
         - Api_attr
- 
           Static Graph 
 This API filters out all variables with persistable==Truefrom the givenmain_programand then tries to load these variables from the directorydirnameor the filefilename.Use the dirnameto specify the directory where persistable variables (refer to Save and Load a Model) were saved. If variables were saved in separate files, setfilenameas None; if all variables were saved in a single file, usefilenameto specify the file name.- Parameters
- 
           - executor (Executor) – The executor used for loading persistable variables. See Executor for more details about it. 
- dirname (str) – The directory path. 
- main_program (Program, optional) – The program whose persistable variables will be loaded. If it is None, the - default_main_programwill be used automatically. See Basic Concept for more about- Program. Default: None.
- filename (str, optional) – The file which saved all persistable variables. If variables were saved in separated files, set it to None. Default: None. 
 
- Returns
- 
           None 
 Examples import paddle import paddle.fluid as fluid paddle.enable_static() exe = fluid.Executor(fluid.CPUPlace()) param_path = "./my_paddle_model" prog = fluid.default_main_program() fluid.io.load_persistables(executor=exe, dirname=param_path, main_program=None) 
