OpenStackで実行されているUbuntu 16.04に1.4
インストールされたTensorFlowを実行しています。pip
TensorFlow 線形モデルのチュートリアル (こちら) に従って、単純なロジスティック回帰モデルを実行しました。ローカルで実行すると、すべて正常に動作します。ここのドキュメントに従って、RunConfig()
小さなクラスターでモデルを実行しています。私が理解している限り、定型推定器を配布するには、適切な JSON 環境変数を設定するだけです。私は次のようにこれを行いました:
rank = int(argv[1])
instance_type = argv[2]
...
cluster = {'chief': ['master:2222'],
'ps': ['master:2223'],
'worker' : ['worker-1:2222']}
os.environ['TF_CONFIG']= json.dumps(
{'cluster': cluster,
'task': {'type': instance_type, 'index': rank}})
...
indep_vars = build_vars()
config = tf.estimator.RunConfig()
lr = tf.estimator.LinearClassifier(model_dir=None,
config = config,
feature_columns=indep_vars)
train_spec = tf.estimator.TrainSpec(
input_fn=lambda: input_fn_logit(data_path, 1, BATCH_SIZE),
max_steps=10)
eval_spec = tf.estimator.EvalSpec(
input_fn=lambda: input_fn_logit(data_path, 1, BATCH_SIZE),
steps=1)
tf.estimator.train_and_evaluate(lr, train_spec, eval_spec)
master
次に、スクリプトをas:python tf_dist_example.py 0 chief
から、別の window:python tf_dist_example.py 0 ps
で、worker-1
as : で呼び出しますpython tf_dist_example.py 0 worker
。
インスタンスはchief
エラーをスローします:tensorflow.python.framework.errors_impl.UnknownError: Could not start gRPC server
を設定した後、エラーexport GRPC_VERBOSITY=DEBUG
をgRPC
報告します:
{"created":"@1513990687.907885617","description":"No address added out of total 1 resolved","file":"external/grpc/src/core/ext/transport/chttp2/server/chttp2_server.c","file_line":245,"referenced_errors":
[{"created":"@1513990687.907882392","description":"Failed to add any wildcard listeners","file":"external/grpc/src/core/lib/iomgr/tcp_server_posix.c","file_line":338,"referenced_errors":
[{"created":"@1513990687.907869775","description":"Unable to configure socket","fd":7,"file":"external/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.c","file_line":200,"referenced_errors":
[{"created":"@1513990687.907859814","description":"OS Error","errno":98,"file":"external/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.c","file_line":173,"os_error":"Address already in use","syscall":"bind"}]},
{"created":"@1513990687.907881598","description":"Unable to configure socket","fd":7,"file":"external/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.c","file_line":200,"referenced_errors":
[{"created":"@1513990687.907879042","description":"OS Error","errno":98,"file":"external/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.c","file_line":173,"os_error":"Address already in use","syscall":"bind"}]}]}]}
エラーは明らかです。gRPC が接続しようとしているポートは既に使用されています。ただし、netstat -tulpn
他のプロセスがこれらのポートを使用していないことを確認したため、gRPC が既に使用されていると不平を言っている理由がわかりません。さらに、手動で and を作成するより低レベルの例を作成するClusterSpec
とServer
、マスターとワーカーは正常に通信でき、すべてが期待どおりに機能します。さらにデバッグする方法について提案したり、どこが間違っているかを指摘したりできますか? 何が起こっているのかについての簡単な説明があると確信しています。役立つ場合は、からのメッセージをさらに含めるgRPC
ことができます。