【问题标题】:Google ML Training task can't find moduleGoogle ML Training 任务找不到模块
【发布时间】:2019-10-12 16:35:27
【问题描述】:

我正在尝试使用 gcloud ml 运行我的 ml Python 脚本,但不断收到错误消息:

/usr/bin/python: No module named trainer

我使用的命令是:

gcloud ai-platform jobs submit training "job6" --job-dir \
"gs://comp10001cards/root" --package-path "C:\\Users\hjstu\desktop" \             
 --module-name trainer.task --region "us-central1"

"C:\\Users\hjstu\desktop" 包含一个__init__.py 文件。 "gs://comp10001cards/root" 包含文件夹 trainer,其中包含一个 __init__.py 文件和我的脚本 task.py

/usr/bin/python 在哪里?我究竟做错了什么?如果有帮助,我将在 C:\\Users\hjstu\desktop 中使用 cmd 中的 gcloud 工具。

【问题讨论】:

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


    【解决方案1】:

    当您运行 jobs submit training 命令时,您的培训模块和 task.py 脚本应该位于您的计算机本地。该命令将打包您的代码,将其发送到云端并执行。

    查看relevant documentation page 了解更多信息。

    【讨论】:

    • 是否可以将 csv 文件捆绑到培训包中?我的项目的 trainer 目录中有一个 csv 文件,但是当我尝试运行训练时代码出错,因为它无法找到 csv 文件,即使它就在那里
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-11-13
    • 2021-01-02
    • 2018-06-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-13
    • 1970-01-01
    相关资源
    最近更新 更多