Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

虚拟机环境:CentOS Linux release 7.5.1804 (Core),nlp-automl运行报错。 #137

Open
cumtqiao opened this issue Nov 26, 2021 · 1 comment

Comments

@cumtqiao
Copy link

代码:
#include
#include <alibabacloud/core/AlibabaCloud.h>
#include <alibabacloud/nlp-automl/Nlp_automlClient.h>

using namespace AlibabaCloud;
using namespace AlibabaCloud::Nlp_automl;

int main(int argc, char** argv) {
// 初始化 SDK
AlibabaCloud::InitializeSdk();

// 配置 nlp_automl 实例
ClientConfiguration configuration("");
Nlp_automlClient client("", "", configuration);

// 创建API请求并设置参数
Model::GetPredictResultRequest request;
request.setModelId(10281);
request.setContent("中华人民共和国解放军");

auto outcome = client.getPredictResult(request);
if (!outcome.isSuccess()) {
// 异常处理
std::cout << outcome.error().errorCode() << std::endl;
AlibabaCloud::ShutdownSdk();
return -1;
}

std::cout << "totalCount: " << outcome.result().getContent() << std::endl;

// 关闭 SDK
AlibabaCloud::ShutdownSdk();
return 0;
}

报错信息:
image

@cumtqiao cumtqiao changed the title 虚拟机版本:CentOS Linux release 7.5.1804 (Core),nlp-automl运行报错。 虚拟机环境:CentOS Linux release 7.5.1804 (Core),nlp-automl运行报错。 Nov 29, 2021
@Wheeeeeeeeels
Copy link

代码: #include #include <alibabacloud/core/AlibabaCloud.h> #include <alibabacloud/nlp-automl/Nlp_automlClient.h>

using namespace AlibabaCloud; using namespace AlibabaCloud::Nlp_automl;

int main(int argc, char** argv) { // 初始化 SDK AlibabaCloud::InitializeSdk();

// 配置 nlp_automl 实例 ClientConfiguration configuration(""); Nlp_automlClient client("", "", configuration);

// 创建API请求并设置参数 Model::GetPredictResultRequest request; request.setModelId(10281); request.setContent("中华人民共和国解放军");

auto outcome = client.getPredictResult(request); if (!outcome.isSuccess()) { // 异常处理 std::cout << outcome.error().errorCode() << std::endl; AlibabaCloud::ShutdownSdk(); return -1; }

std::cout << "totalCount: " << outcome.result().getContent() << std::endl;

// 关闭 SDK AlibabaCloud::ShutdownSdk(); return 0; }

报错信息: image
not integrate the service right,you can try to integrate again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants