I have deployed my App on Vertex AI endpoint. The endpoint is created successfully and I am getting "
Active
" status. But when I try to invoke the endpoint, I am getting the following error:
{ "error": { "code": 500, "message": "Prediction failed. Please contact cloudml-feedback@google.com", "status": "INTERNAL" } }
POST Request URL: https://us-central1-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/us-central1/endpoints/${ENDPOINT_ID}:predict
Header: I am passing the required header i.e., Content-Type: application/json and Authorization token.
Body: { "instances": [{ "image_path": "https://github.com/naqishah13/multilabelimages/blob/main/movie-poster-1.jpg?raw=true" } ] }
Here is my flask code that I am using for prediction:
@app.route('/get_movie_genres/', methods=['POST'])
def main():
request_json = request.get_json()
request_instances = request_json['instances']
image_path = request_instances[0]['image_path']
predicted_genres = predict_(image_path)
output = {'predictions':
[
{
'predicted_genres' : prediction
}
]
}
return jsonify(output)
I have saved some images on Github and I am using those images (via Github path) in order to do the movie genre prediction.
Kindly let me know if I am doing something wrong and what might be causing the issue.
What I have tried:
I have tried invoking the endpoint using
curl
command, but still I am getting the permission related errors even though I have provided the authentication correctly.