Aws Sagemaker调用端点调用和csv

时间:2018-05-28 19:08:58

标签: amazon-web-services amazon-sagemaker

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

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

aws帮助   aws帮助   aws帮助 aws:error:argument --body:期望一个参数"

如果它是正数,那么一切正常。如何逃避数据的第一个减号以使其工作? 提前致谢

2 个答案:

答案 0 :(得分:0)

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

答案 1 :(得分:0)

由于负号和连字符相同,因此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
相关问题