diff --git a/paddle/fluid/train/custom_trainer/feed/scripts/create_programs.py b/paddle/fluid/train/custom_trainer/feed/scripts/create_programs.py index e1fad3941b87ed29092b2c475786ad53df762e9f..1adeb70455f6e19de37e727d25d9bdf5c9ee1fca 100644 --- a/paddle/fluid/train/custom_trainer/feed/scripts/create_programs.py +++ b/paddle/fluid/train/custom_trainer/feed/scripts/create_programs.py @@ -121,6 +121,14 @@ class ModelBuilder: with open(os.path.join(self._save_path, name), 'w') as f: f.write(program.desc.serialize_to_string()) + fluid.io.save_inference_model(self._save_path, + [var.name for var in inputs], + outputs, + executor=None, + main_program=test_program, + model_filename='inference_program', + program_only=True) + params = filter(fluid.io.is_parameter, main_program.list_vars()) vars = [] sums=[]