【问题标题】:Aws Sagemaker invoke-endpoint call and csvAws Sagemaker 调用端点调用和 csv
【发布时间】:2018-11-07 09:32:18
【问题描述】:

我已经在 sagemaker 上创建了一个集群模型,我正在通过 CLI 使用以下命令调用它: aws sagemaker-runtime invoke-endpoint --endpoint-name myendpoint --body $mydata --content-type text/csv output.json --region eu-west-1

如果我的数据以负数开头,我会收到错误消息 “用法:aws [选项] [...] [参数] 要查看帮助文本,您可以运行:

aws 帮助 帮助 帮助 aws: 错误: 参数 --body: 需要一个参数"

虽然它是一个正数,但一切正常。我怎样才能逃避数据的第一个减号以使其工作? 提前致谢

【问题讨论】:

    标签: amazon-web-services amazon-sagemaker


    【解决方案1】:

    看起来 aws cli 将您的输入数据视为另一种选择,因为负号和连字符相同。

    您是否尝试过使用quotes before and after $mydata?

    例如,而不是:

    sagemaker-runtime invoke-endpoint --endpoint-name myendpoint --body -2,1,2 --content-type text/csv output.json --region eu-west-1
    

    使用:

    sagemaker-runtime invoke-endpoint --endpoint-name myendpoint --body "-2,1,2" --content-type text/csv output.json --region eu-west-1
    

    【讨论】:

      【解决方案2】:

      您是否使用 AWS Sagemaker 提供的映像进行集群?如果您提供了自己的,您应该能够修改推理代码以期望输入数据具有标题行。然后修改 $mydata 以包含列标题,这样可以避免您在使用负数时看到的这个问题。

      【讨论】:

        猜你喜欢
        • 2019-07-04
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-04-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多