我正在使用
在Google云平台上提交培训工作gcloud ai-platform jobs submit training $JOB_NAME
--scale-tier basic
--package-path $TRAINING_PACKAGE_PATH
--module-name $MAIN_TRAINER_MODULE
--job-dir $JOB_DIR
--runtime-version $RUNTIME_VERSION
--python-version $PYTHON_VERSION
--region $REGION
我的训练代码看起来有点像在线教程cloudml-samples中的代码。 在Packaging a Training Application指南中,我看到您可以通过添加
将参数传递给培训工作-- \
--user_first_arg=first_arg_value \
--user_second_arg=second_arg_value
但是在任何地方我都能找到如何从训练代码中读取参数。有什么建议么?谢谢
答案 0 :(得分:0)
答案 1 :(得分:0)
我知道我可能不正确地使用了dockerfile,但是为了接受用户args,我的gcloud查询看起来像这样:
Something went wrong
Dockerfile
gcloud ai-platform jobs submit training $JOB_NAME /
--region $REGION /
--master-image-uri $IMAGE_URI /
-- /
app.py --user_first_arg=first_arg_value
app.py
...
WORKDIR /app
COPY . /app
ENTRYPOINT ["python"]
CMD ["app.py"]