gpt4 book ai didi

python - Google Cloud Platform,人工智能和机器学习产品,入门 : Training and Prediction with TensorFlow Estimator

转载 作者:行者123 更新时间:2023-12-04 10:14:37 25 4
gpt4 key购买 nike

我尝试使用 TensorFlow Estimator 完成训练和预测的测试。
我当前的步骤是“提交批量预测作业”( https://cloud.google.com/ai-platform/docs/getting-started-tensorflow-estimator#submit_a_batch_prediction_job )。
命令是

gcloud ai-platform jobs submit prediction $JOB_NAME \
--model $MODEL_NAME \
--version v1 \
--data-format text \
--region $REGION \
--input-paths $TEST_JSON \
--output-path $OUTPUT_PATH/predictions

所有变量现在都有值了。但是 $TEST_JSON 没有。
JOB_NAME=census_prediction_1
MODEL_NAME=census
REGION=europe-west1
OUTPUT_PATH=gs://$BUCKET_NAME/$JOB_NAME

它是--input-path。
我试过用
TEST_JSON=../test.json

但有错误:
错误:(gcloud.ai-platform.jobs.submit.prediction)FAILED_PRECONDITION:字段:input_paths 错误:无法读取提供的 GCS 路径 [../test.json]。请确保对象存在并且您对它具有读取权限。
如果我检查
cat $TEST_JSON

文件 ../test.json 打开 OK。
我不明白错误在哪里。

最佳答案

输入路径是一个 GCS 存储桶
按以下方式设置变量;

TEST_JSON=gs://$BUCKET_NAME/data/test.json

根据您的描述,您似乎正在使用本地存储的 test.json;

它是--input-path。我试过用

TEST_JSON=../test.json

From the doc gcloud ai-platform jobs submit prediction;

--input-paths=INPUT_PATH,[INPUT_PATH,…] Google Cloud Storage paths to the instances to run prediction on. Wildcards () accepted at the end of a path. More than one path can be specified if multiple file patterns are needed. For example, gs://my-bucket/instances,gs://my-bucket/other-instances1

关于python - Google Cloud Platform,人工智能和机器学习产品,入门 : Training and Prediction with TensorFlow Estimator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61139450/

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