【问题标题】:Google Cloud ML using Python 2.7使用 Python 2.7 的 Google Cloud ML
【发布时间】:2019-10-13 14:46:38
【问题描述】:

我有一个 ML python 脚本,我已将其作为作业提交给 Google Cloud ML,但在使用 * 解压缩列表时不断收到语法错误。然后我意识到我的代码是在 Python V2.7 中执行的。为什么会这样,Google Cloud ML 可以设置为使用 Python V3 吗?

谢谢

【问题讨论】:

标签: python google-cloud-platform google-cloud-ml


【解决方案1】:

正如谷歌文档中提到的,

AI Platform 默认运行 Python 2.7。 当您使用 AI Platform 运行时版本 1.4 或更高版本时,Python 3.5 可用。

例如:

training_inputs = {'scaleTier': 'BASIC',
    'packageUris': ['gs://my/trainer/path/package-0.0.0.tar.gz'],
    'pythonModule': 'trainer.task'
    'args': ['--arg1', 'value1', '--arg2', 'value2'],
    'region': 'us-central1',
    'jobDir': 'gs://my/training/job/directory',
    'runtimeVersion': '1.13',
    'pythonVersion': '3.5'}

更多信息,请参考:

https://cloud.google.com/ml-engine/docs/tensorflow/environment-overview

https://cloud.google.com/ml-engine/docs/tensorflow/versioning#set-python-version-training

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-09-19
    • 2017-08-03
    • 1970-01-01
    • 2018-03-24
    • 2018-06-08
    • 2018-07-12
    • 1970-01-01
    相关资源
    最近更新 更多