From 05715d19b5e3a25c7db73743b1188d379843d724 Mon Sep 17 00:00:00 2001 From: ml server Date: Tue, 28 Jan 2020 17:36:24 -0700 Subject: [PATCH] wut worker train scripts --- wut-train-cluster-fn.py | 10 ++++++---- wut-worker-train-cluster-fn | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/wut-train-cluster-fn.py b/wut-train-cluster-fn.py index 650a0e3..34626da 100644 --- a/wut-train-cluster-fn.py +++ b/wut-train-cluster-fn.py @@ -1,5 +1,7 @@ -#!/usr/bin/env python -# coding: utf-8 +#!/usr/bin/env python3 +# +# wut-train-cluster-fn.py +# # In[ ]: @@ -67,10 +69,10 @@ print('tf {}'.format(tf.__version__)) os.environ["TF_CONFIG"] = json.dumps({ "cluster": { - "worker": [ "ml0-int:2222", "ml1-int:2222", "ml2-int:2222", "ml3-int:2222", "ml4-int:2222", "ml5-int:2222" ] + "worker": ["ml1-int:2222", "ml2-int:2222", "ml3-int:2222", "ml4-int:2222", "ml5-int:2222" ] }, "task": {"type": "worker", "index": 0 }, - "num_workers": 6 + "num_workers": 5 }) diff --git a/wut-worker-train-cluster-fn b/wut-worker-train-cluster-fn index a570458..870065b 100755 --- a/wut-worker-train-cluster-fn +++ b/wut-worker-train-cluster-fn @@ -17,8 +17,9 @@ # so the index is hostname minus one (without alpha). HOSTNUM=`hostname | sed -e 's/ml//g'` +let HOSTNUM=$HOSTNUM-1 -export TF_CONFIG='{"cluster": {"worker": [ "ml0-int:2222", "ml1-int:2222", "ml2-int:2222", "ml3-int:2222", "ml4-int:2222", "ml5-int:2222"]}, "task": {"index": '$HOSTNUM', "type": "worker"}}' +export TF_CONFIG='{"cluster": {"worker": [ "ml1-int:2222", "ml2-int:2222", "ml3-int:2222", "ml4-int:2222", "ml5-int:2222"]}, "task": {"index": '$HOSTNUM', "type": "worker"}}' echo $TF_CONFIG python3 wut-train-cluster-fn.py