没有名为 trainer、Cloud ML Engine for TensorFlow Tutorial 的模块,运行 本地

No module named trainer, Cloud ML Engine for TensorFlow Tutorial, Running Locally

Tutorial I am following

一直在尝试按照 Google 教程使用 ML Engine for TensorFlow。卡在 "run a local training job" 的地方,出现错误

/usr/bin/python: No module named trainer

完整命令是:

gcloud ml-engine local train \
    --module-name trainer.task \
    --package-path trainer/ \
    --job-dir $MODEL_DIR \
    -- \
    --train-files $TRAIN_DATA \
    --eval-files $EVAL_DATA \
    --train-steps 1000 \
    --eval-steps 100

据我所知,这三个变量都已正确设置,但现在甚至还没有得到它们。本教程没有指定下载培训师文件或如何引用它,过去一个小时的谷歌搜索没有找到任何有效的解决方案。找到了这个一般解释:

--module-name specifies the name of your application's main module, using your package's namespace dot notation. This is the Python file that you run to start your application. For example, if your main module is .../my_application/trainer/task.py (see the recommended project structure), then the module name is trainer.task

如有任何信息,我们将不胜感激。

感谢 Dustin 在评论中提供的信息找到了解决方案。

只是在云 Shell 上下载培训师目录,而不是我的本地环境。

现在的文件结构如下:

estimator
    |-- data
    |   |-- adult_data.csv
    |   |-- adult_test.csv
    |-- output
    |-- trainer
    |   |-- __init__.py
    |   |-- model.py
    |   |-- task.ipynb
    |   |-- task.py