diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index f6cfe462e156dc95ddf64ca8d89f06775af92fa7..5b3e1aca8d938a49a6ae0dea45ce122fddbe7b40 100644 --- a/python/paddle/fluid/io.py +++ b/python/paddle/fluid/io.py @@ -222,13 +222,13 @@ def save_vars(executor, continue new_var = _clone_var_in_block_(save_block, each_var) if filename is None: + save_file_path = os.path.join(save_dirname, new_var.name) + save_file_path = os.path.normpath(save_file_path) save_block.append_op( type='save', inputs={'X': [new_var]}, outputs={}, - attrs={ - 'file_path': os.path.join(save_dirname, new_var.name) - }) + attrs={'file_path': save_file_path}) else: save_var_map[new_var.name] = new_var