Skip to content

Commit

Permalink
Fix error in onmt-main when using run types other than train (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaumekln authored Apr 14, 2020
1 parent f14c05a commit 45d3f82
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opennmt/bin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def main():
tf.config.threading.set_inter_op_parallelism_threads(args.inter_op_parallelism_threads)

gpus = tf.config.list_physical_devices(device_type="GPU")
if args.horovod:
if hasattr(args, "horovod") and args.horovod:
import horovod.tensorflow as hvd # pylint: disable=import-outside-toplevel
hvd.init()
is_master = hvd.rank() == 0
Expand Down

0 comments on commit 45d3f82

Please sign in to comment.