小编Suj*_*DSa的帖子

如何使用邮递员将请求传递给 sagemaker

我已经在 sagemaker 上训练了一个模型并创建了端点。我正在尝试使用邮递员调用端点。但是在训练模型时甚至在那之后,我还没有为训练数据指定任何标题。我不知道如何在向 sagemaker 发送帖子请求时创建有效负载

web-services amazon-web-services postman amazon-sagemaker

6
推荐指数
2
解决办法
4527
查看次数

使用 sagemaker api 调用端点时出错

我已经在 sagemaker 中部署了一个端点,并试图通过我的 python 程序调用它。我已经使用邮递员对其进行了测试,并且运行良好。然后我写的调用代码如下

import boto3
import pandas as pd
import io
import numpy as np

def np2csv(arr):
    csv = io.BytesIO()
    np.savetxt(csv, arr, delimiter=',', fmt='%g')
    return csv.getvalue().decode().rstrip()


runtime= boto3.client('runtime.sagemaker')
payload = np2csv(test_X)

runtime.invoke_endpoint(
    EndpointName='<my-endpoint-name>',
    Body=payload,
    ContentType='text/csv',
    Accept='Accept'
)
Run Code Online (Sandbox Code Playgroud)

现在当我运行它时,我收到一个验证错误

ValidationError: An error occurred (ValidationError) when calling the InvokeEndpoint operation: Endpoint <my-endpoint-name> of account <some-unknown-account-number> not found.
Run Code Online (Sandbox Code Playgroud)

在使用邮递员时,我已经提供了我的访问密钥和秘密密钥,但我不确定在使用 sagemaker apis 时如何传递它。我也无法在文档中找到它。

所以我的问题是,如何使用本地机器上的 sagemaker api 来调用我的端点?

python amazon-web-services python-3.x amazon-sagemaker

5
推荐指数
2
解决办法
3293
查看次数

无法在 AWS Sagemaker 上安装 spacy

我正在尝试将 spacy 加载到 SageMaker 中。我在 Jupyter 笔记本实例中运行以下命令

!pip install spacy
Run Code Online (Sandbox Code Playgroud)

我最终收到这个错误

  gcc: error trying to exec 'cc1plus': execvp: No such file or directory
  error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

还有这个

gcc: error: murmurhash/mrmr.cpp: No such file or directory
error: command 'gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)

如何使用 Sagemaker 解决此问题?

linux amazon-web-services python-3.x spacy amazon-sagemaker

5
推荐指数
1
解决办法
5424
查看次数

包 org.junit 不存在 Junit 5

我尝试了这里提到的所有选项

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.traform</groupId>
  <artifactId>CardsClient</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  
  <build>
    <testSourceDirectory>src/test/java</testSourceDirectory>
    <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.8.1</version>
      <configuration>
          <source>1.8</source>
          <target>1.8</target>
      </configuration>
  </plugin>
        <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.22.2</version>
        </plugin>
        <plugin>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>2.22.2</version>
        </plugin>
    </plugins>
</build>
  <dependencies>
  <!-- https://mvnrepository.com/artifact/org.hamcrest/hamcrest-all -->
<dependency>
    <groupId>org.hamcrest</groupId>
    <artifactId>hamcrest-all</artifactId>
    <version>1.3</version>
    <scope>test</scope>
</dependency>
  
  <dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.17</version>
    <type>jar</type>
    <scope>runtime</scope>
</dependency>
  <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>5.6.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-engine</artifactId>
        <version>5.6.2</version>
        <scope>test</scope>
    </dependency>
    <dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-core</artifactId>
  <version>2.9.6</version>
</dependency>

<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-annotations</artifactId>
  <version>2.9.6</version>
</dependency>

<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-databind</artifactId>
  <version>2.9.6</version>
</dependency>

<!-- https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp …
Run Code Online (Sandbox Code Playgroud)

eclipse maven junit5

3
推荐指数
1
解决办法
6953
查看次数

如何解释h2o.predict的结果

运行h2o.deeplearning以获取二进制分类问题后,我运行h2o.predict并获得以下结果

  predict        No       Yes
1      No 0.9784425 0.0215575
2     Yes 0.4667428 0.5332572
3     Yes 0.3955087 0.6044913
4     Yes 0.7962034 0.2037966
5     Yes 0.7413591 0.2586409
6     Yes 0.6800801 0.3199199
Run Code Online (Sandbox Code Playgroud)

我希望得到一个只有两行的混淆矩阵.但这似乎有很大不同.我如何解释这些结果?是否有任何方法可以获得具有实际和预测值以及误差百分比的混淆矩阵?

r machine-learning neural-network deep-learning h2o

1
推荐指数
1
解决办法
3866
查看次数

如何加载Sagemaker中没有的python模块?

我想安装spacy,它不是Sagemaker平台的一部分.我应该如何安装呢?

amazon-web-services amazon-sagemaker

1
推荐指数
2
解决办法
1226
查看次数