Poleg
Poleg

Reputation: 21

Google Cloud Platform, AI & Machine Learning Products, Getting started: Training and Prediction with TensorFlow Estimator

i try to complete test from Training and prediction with TensorFlow Estimator. My current step is "Submit a batch prediction job" (https://cloud.google.com/ai-platform/docs/getting-started-tensorflow-estimator#submit_a_batch_prediction_job). Command is

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

All variables have value now. But $TEST_JSON dont have.

JOB_NAME=census_prediction_1
MODEL_NAME=census
REGION=europe-west1
OUTPUT_PATH=gs://$BUCKET_NAME/$JOB_NAME

It is --input-path. I tried use

TEST_JSON=../test.json

but there is error: ERROR: (gcloud.ai-platform.jobs.submit.prediction) FAILED_PRECONDITION: Field: input_paths Error: The provided GCS paths [../test.json] cannot be read. Please make sure that the objects exist and you have read access to it. If i check

cat $TEST_JSON

file ../test.json opening OK. I dont understand where is mistake.

Upvotes: 2

Views: 125

Answers (1)

Paddy Popeye
Paddy Popeye

Reputation: 1814

The input path is meant to be a GCS bucket Set the variable in the manner below;

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

From your description it seems you are using test.json, locally stored;

It is --input-path. I tried use

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

Upvotes: 2

Related Questions