fluid.io.load_vars指定filename时无法load
Created by: yinweichong
fluid.io.save_persistables和fluid.io.load_vars组合使用,不指定filename时,没问题。指定filename时,报错,部分报错信息如下:
new_var = _clone_var_in_block_(load_block, each_var)
paddle.fluid.core.EnforceNotMet: Getting 'tensor_desc' is not supported by the type of var train_py_reader_reader. at [/paddle/paddle/fluid/framework/var_desc.cc:207]
- save代码:
fluid.io.save_persistables(exe, model_path, main_program=program, filename="XXXX")
参考paddle models中的代码https://github.com/PaddlePaddle/models/blob/652493c158f44245f2188c45623822fe5204ad12/PaddleCV/video/tools/train_utils.py#L146
- load代码
fluid.io.load_vars(exe, args.resume, main_program=train_prog, filename="XXXX")
参考paddle models中的代码 https://github.com/PaddlePaddle/models/blob/652493c158f44245f2188c45623822fe5204ad12/PaddleCV/video/train.py#L161