我尝试用TensorFlow估计器完成训练和预测的测试。我当前的步骤是“提交批量预测作业”(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但出现错误: error:(gcloud.ai-platform.jobs.submit.recast) FAILED_PRECONDITION: Field: test.json错误:提供的GCS路径../ input_paths无法读取。请确保这些对象存在,并且您对其具有读取访问权限。如果我检查
cat $TEST_JSON文件../test.json打开正常。我不明白哪里错了。
发布于 2020-04-10 20:43:36
输入路径是一个GCS存储桶,以下面的方式设置变量;
TEST_JSON=gs://$BUCKET_NAME/data/test.json
从您的描述看,您似乎正在使用本地存储的test.json;
它是--input-path。我试着用
TEST_JSON=../test.json
来自文档gcloud ai-platform jobs submit prediction的
;
--输入路径=输入路径、INPUT_PATH、…要运行预测的实例的Google云存储路径。路径末尾接受的通配符()。如果需要多个文件模式,则可以指定多个路径。例如,gs://my-bucket/instances,gs://my-bucket/other-instances1
https://stackoverflow.com/questions/61139450
复制相似问题