Using endpoint [https://ml.googleapis.com/]
{
"error": "Prediction failed: Error during model execution: AbortionError(code=StatusCode.FAILED_PRECONDITION, details=\"Error while reading resource variable dense/kernel from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/dense/kernel)\n\t [[{{node dense/MatMul/ReadVariableOp}}]]\")"
}
**Expected behavior**
The predicted result is shown properly.
Describe the bug This tutorial does not work properly. https://cloud.google.com/ai-platform/docs/getting-started-keras
Source code / logs https://github.com/GoogleCloudPlatform/cloudml-samples/blob/master/notebooks/tensorflow/getting-started-keras.ipynb
To Reproduce Steps to reproduce the behavior:
Get a list of directories in the
keras_export
parent directoryKERAS_EXPORT_DIRS = ! gsutil ls $JOB_DIR/keras_export/
Pick the directory with the latest timestamp, in case you've trained
multiple times
SAVED_MODEL_PATH = KERAS_EXPORT_DIRS[-1]
! gsutil cp $JOB_DIR/keras_export/saved_model.pb $JOB_DIR/keras_export/variables/
Create model version based on that SavedModel directory
! gcloud ai-platform versions create $MODEL_VERSION \ --model $MODEL_NAME \ --runtime-version 1.15 \ --python-version 3.7 \ --framework tensorflow \ --origin $SAVED_MODEL_PATH
gcloud ai-platform predict \ --model $MODEL_NAME \ --version $MODEL_VERSION \ --json-instances prediction_input.json
Using endpoint [https://ml.googleapis.com/] { "error": "Prediction failed: Error during model execution: AbortionError(code=StatusCode.FAILED_PRECONDITION, details=\"Error while reading resource variable dense/kernel from Container: localhost. This could mean that the variable was uninitialized. Not found: Container localhost does not exist. (Could not find resource: localhost/dense/kernel)\n\t [[{{node dense/MatMul/ReadVariableOp}}]]\")" }