Google NLP AutoML Java客户端提供的位置ID无效 [英] Google NLP AutoML Java client The provided location ID is not valid

查看:130
本文介绍了Google NLP AutoML Java客户端提供的位置ID无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从GitHub Java示例中检出了GoogleCloudPlatform.在成功训练语言模型之后,我试图为AutoML NLP预测运行此示例.我可以在Google Cloud Console中执行预测.现在,我尝试使用此示例

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

我为我的项目创建了服务帐户,为JSON密钥设置了GOOGLE_APPLICATION_CREDENTIALS,并且在PredictionApi.java示例中使用了正确的projectId,modelId和computeRegion参数.在Idea中运行它之后,这是我得到的错误:

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:

线程"main"中的异常com.google.api.gax.rpc.InvalidArgumentException:io.grpc.StatusRuntimeException:INVALID_ARGUMENT:发现的错误列表:1.Field:名称;消息:提供的位置ID无效.

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.

有人知道是什么错误或我的配置中缺少什么吗? (总而言之,我有项目,服务帐户,训练有素的模型,设置了GOOGLE_PROJECT_CREDENTIALS)

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)

推荐答案

您设置了什么computeRegion?当前,automl API仅支持us-central1.

What computeRegion did you set? Currently, only us-central1 is supported in automl API.

这篇关于Google NLP AutoML Java客户端提供的位置ID无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆