From 6fc1defd778e51aa0c3b127c50bbc6101bb526fd Mon Sep 17 00:00:00 2001 From: wuzewu Date: Thu, 15 Aug 2019 15:37:57 +0800 Subject: [PATCH] Fix compatibility issue of fluid.io.save_vars on windows platform (#19181) --- python/paddle/fluid/io.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/io.py b/python/paddle/fluid/io.py index f6cfe462e1..5b3e1aca8d 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 -- GitLab