Skip to content

Commit 7ab4ad6

Browse files
author
Macdonald
committed
hosts is an array
1 parent 8890bc6 commit 7ab4ad6

File tree

1 file changed

+1
-1
lines changed
  • sagemaker-python-sdk/mxnet_gluon_mnist

1 file changed

+1
-1
lines changed

sagemaker-python-sdk/mxnet_gluon_mnist/mnist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def train(channel_input_dirs, hyperparameters, hosts, **kwargs):
4141
# Collect all parameters from net and its children, then initialize them.
4242
net.initialize(mx.init.Xavier(magnitude=2.24), ctx=ctx)
4343
# Trainer is for updating parameters with gradient.
44-
store = kv.create('dist_sync' if hosts > 1 else 'local')
44+
store = kv.create('dist_sync' if len(hosts) > 1 else 'local')
4545
trainer = gluon.Trainer(net.collect_params(), 'sgd',
4646
{'learning_rate': learning_rate, 'momentum': momentum},
4747
kvstore=store)

0 commit comments

Comments
 (0)