问题
I checked out from GitHub Java samples for GoogleCloudPlatform. I am trying to run this example for AutoML NLP prediction after I successfully trained my language model. I am able to perform prediction in the Google Cloud Console. Now I am trying to perform prediction from Java client with this example https://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/language/automl/src/main/java/com/google/cloud/language/samples/PredictionApi.java
I created service account for my project, set GOOGLE_APPLICATION_CREDENTIALS for my JSON key and I use correct projectId, modelId and computeRegion arguments in the PredictionApi.java example. After I run it in Idea, this is error that I get:
Exception in thread "main" com.google.api.gax.rpc.InvalidArgumentException: io.grpc.StatusRuntimeException: INVALID_ARGUMENT: List of found errors: 1.Field: name; Message: The provided location ID is not valid.
Does somebody have clue what could be wrong or what am I missing in my configuration? (to summarize it I have project, service account, trained model, set GOOGLE_PROJECT_CREDENTIALS)
回答1:
What computeRegion
did you set? Currently, only us-central1
is supported in automl API.
来源:https://stackoverflow.com/questions/54329128/google-nlp-automl-java-client-the-provided-location-id-is-not-valid