gpt4 book ai didi

python - 没有名为 trainer 的模块,用于 TensorFlow 教程的 Cloud ML Engine,在本地运行

转载 作者:太空宇宙 更新时间:2023-11-03 11:59:42 25 4
gpt4 key购买 nike

Tutorial I am following

一直在尝试按照 Google 教程使用 ML Engine for TensorFlow。卡在它说“运行本地培训作业”的地方并出现错误

/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 在评论中提供的信息找到了解决方案。

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

现在文件结构如下所示:

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

关于python - 没有名为 trainer 的模块,用于 TensorFlow 教程的 Cloud ML Engine,在本地运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53378242/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com