Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Amazon sagemaker 如何判断一份工作的成本_Amazon Sagemaker - Fatal编程技术网

Amazon sagemaker 如何判断一份工作的成本

Amazon sagemaker 如何判断一份工作的成本,amazon-sagemaker,Amazon Sagemaker,有没有办法知道一份个人培训工作要花多少钱 我可以在计费仪表板中看到每日/每小时成本,这是一个很好的代理。我也查看了使用情况报告,但没有找到将usagevalue相加的方法,也没有看到标签进入到使用情况报告中。调用API调用时,会得到以下值:TrainingStartTime和TrainingdTime。您将按这两个时间间隔计费 现在,您需要在ResourceConfig下(在相同的API调用输出中)获取下两个值以完成成本计算:InstanceType和InstanceCount 最后,您可以查询

有没有办法知道一份个人培训工作要花多少钱

我可以在计费仪表板中看到每日/每小时成本,这是一个很好的代理。我也查看了使用情况报告,但没有找到将usagevalue相加的方法,也没有看到标签进入到使用情况报告中。

调用API调用时,会得到以下值:TrainingStartTime和TrainingdTime。您将按这两个时间间隔计费

现在,您需要在ResourceConfig下(在相同的API调用输出中)获取下两个值以完成成本计算:InstanceType和InstanceCount

最后,您可以查询正在使用的InstanceType,并获得正在运行的地区的价格

import boto3
pricing_client = boto3.client('pricing', region_name='us-east-1')
filterValue = instanceType + "-Training"

response = pricing_client.get_products(
    ServiceCode='AmazonSageMaker',
    Filters=[
        {
            'Type': 'TERM_MATCH',
            'Field': 'instanceType',
            'Value': filterValue
        },
    ]
)
## TODO: fix this line to take the right region and not the first
python_dict = json.loads(response['PriceList'][0])

pricePerHour = next(iter(next(iter(python_dict['terms']['OnDemand'].values()))["priceDimensions"].values()))["pricePerUnit"]['USD']
return float(pricePerHour)
调用API调用时,将获得以下值:TrainingStartTime和TrainingEndTime。您将按这两个时间间隔计费

现在,您需要在ResourceConfig下(在相同的API调用输出中)获取下两个值以完成成本计算:InstanceType和InstanceCount

最后,您可以查询正在使用的InstanceType,并获得正在运行的地区的价格

import boto3
pricing_client = boto3.client('pricing', region_name='us-east-1')
filterValue = instanceType + "-Training"

response = pricing_client.get_products(
    ServiceCode='AmazonSageMaker',
    Filters=[
        {
            'Type': 'TERM_MATCH',
            'Field': 'instanceType',
            'Value': filterValue
        },
    ]
)
## TODO: fix this line to take the right region and not the first
python_dict = json.loads(response['PriceList'][0])

pricePerHour = next(iter(next(iter(python_dict['terms']['OnDemand'].values()))["priceDimensions"].values()))["pricePerUnit"]['USD']
return float(pricePerHour)

我投票结束这个问题,因为这是一个供应商客户服务问题,而不是指南中定义的编程问题。这不是一个定价问题,但是,关于一种控制使用云计算进行培训成本的程序化方法,我投票将这个问题作为离题回答,因为这是一个供应商客户服务问题,而不是指南中定义的编程问题。这不是一个定价问题,但是关于一种控制使用云进行培训工作的成本的编程方法