File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ def is_persistable(var):
65
65
Examples:
66
66
.. code-block:: python
67
67
68
- param = fluid.default_main_program().global_block().var('fc.w ')
68
+ param = fluid.default_main_program().global_block().var('fc.b ')
69
69
res = fluid.io.is_persistable(param)
70
70
"""
71
71
if var .desc .type () == core .VarDesc .VarType .FEED_MINIBATCH or \
@@ -625,8 +625,13 @@ def save_inference_model(dirname,
625
625
main_program ._distributed_lookup_table ,
626
626
main_program ._endpoints )
627
627
628
- if not os .path .isdir (dirname ):
628
+ # when a pserver and a trainer running on the same machine, mkdir may conflict
629
+ try :
629
630
os .makedirs (dirname )
631
+ except OSError as e :
632
+ if e .errno != errno .EEXIST :
633
+ raise
634
+
630
635
if model_filename is not None :
631
636
model_basename = os .path .basename (model_filename )
632
637
else :
You can’t perform that action at this time.
0 commit comments