【发布时间】:2020-06-16 19:53:58
【问题描述】:
我正在尝试在 Google Cloud Platform (GCP) ML 引擎(又名 AI 平台)上实现这个分布式 Keras Tuner 示例: https://github.com/keras-team/keras-tuner/blob/master/docs/templates/tutorials/distributed-tuning.md
这是我的 ML 训练输入 .yaml:
scaleTier : CUSTOM
masterType: standard
masterConfig:
imageUri: tensorflow/tensorflow:2.1.0-gpu-py3
workerCount: 8
workerType: standard_gpu
workerConfig:
imageUri: tensorflow/tensorflow:2.1.0-gpu-py3
在python脚本的顶部,我添加:
tf_config = json.loads(os.environ['TF_CONFIG'])
cluster = tf_config['cluster']
task = tf_config['task']
master_addr = cluster['master'][0].split(':')
os.environ['KERASTUNER_ORACLE_IP'] = master_addr[0]
os.environ['KERASTUNER_ORACLE_PORT'] = '8000'
if task['type'] == 'master':
os.environ['KERASTUNER_TUNER_ID'] = 'chief'
else:
os.environ['KERASTUNER_TUNER_ID'] = 'tuner{}'.format(task['index'])
很遗憾,这不起作用。 master返回错误:
server_chttp2.cc:40] {"created":"@1580940408.588629852","description":"No address added out of total 1 resolved","file":"src/core/ext/transport/chttp2/server/chttp2_server.cc","file_line":395,"referenced_errors":[{"created":"@1580940408.588623412","description":"Unable to configure socket","fd":22,"file":"src/core/lib/iomgr/tcp_server_utils_posix_common.cc","file_line":208,"referenced_errors":[{"created":"@1580940408.588609041","description":"Cannot assign requested address","errno":99,"file":"src/core/lib/iomgr/tcp_server_utils_posix_common.cc","file_line":181,"os_error":"Cannot assign requested address","syscall":"bind"}]}]}
因此,master 似乎无法绑定到监听端口。
所以,我想真正的问题是:如何绑定到 GCP ML 引擎上的监听端口?这允许吗?
感谢您现在就如何在 GCP ML 引擎上运行分布式 Keras Tuning 提供任何见解。
【问题讨论】:
-
如果您使用cloud.google.com/ai-platform/training/docs/… 所支持的 TensorFlow 版本之一...您是否仍然看到相同的错误.. TF 2.x 尚不受支持
标签: python tensorflow keras google-cloud-platform