Skip to content

Commit

Permalink
only freeze in rank 0 (#2937)
Browse files Browse the repository at this point in the history
Fix #2272.

Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz authored Oct 19, 2023
1 parent 64a5aa8 commit b588928
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion deepmd/entrypoints/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,13 @@ def freeze(
# We import the meta graph and retrieve a Saver
try:
# In case paralle training
import horovod.tensorflow as _ # noqa: F401
import horovod.tensorflow as HVD
except ImportError:
pass
else:
HVD.init()
if HVD.rank() > 0:
return
saver = tf.train.import_meta_graph(
f"{input_checkpoint}.meta", clear_devices=clear_devices
)
Expand Down

0 comments on commit b588928

Please sign in to comment.