in ci/frcnn/parse_and_submit.py [0:0]
def upload_metrics(parsed_results, num_gpus, batch_size, instance_type, platform):
client = boto3.client('cloudwatch')
print(parsed_results['ap_0.95_all'])
client.put_metric_data(
Namespace='ModelOptimization',
MetricData=[
{
'MetricName': 'Precision-0.50:0.95-all',
'Value': parsed_results['ap_0.95_all'],
'Dimensions': [
{
'Name': 'Model',
'Value': 'FasterRCNN'
},
{
'Name': 'Platform',
'Value': str(platform)
},
{
'Name': 'Instance Type',
'Value': str(instance_type)
},
{
'Name': 'Num of GPUs',
'Value': 'GPUs:' + str(num_gpus)
},
{
'Name': 'Batch Size',
'Value': 'Batche Size:' + str(batch_size)
}
]
}
]
)
print(parsed_results['ap_0.50_all'])
client.put_metric_data(
Namespace='ModelOptimization',
MetricData=[
{
'MetricName': 'Precision-0.50-all',
'Value': parsed_results['ap_0.50_all'],
'Dimensions': [
{
'Name': 'Model',
'Value': 'FasterRCNN'
},
{
'Name': 'Platform',
'Value': str(platform)
},
{
'Name': 'Instance Type',
'Value': str(instance_type)
},
{
'Name': 'Num of GPUs',
'Value': 'GPUs:' + str(num_gpus)
},
{
'Name': 'Batch Size',
'Value': 'Batch Size:' + str(batch_size)
}
]
}
]
)
print(parsed_results['ap_0.75_all'])
client.put_metric_data(
Namespace='ModelOptimization',
MetricData=[
{
'MetricName': 'Precision-0.75-all',
'Value': parsed_results['ap_0.75_all'],
'Dimensions': [
{
'Name': 'Model',
'Value': 'FasterRCNN'
},
{
'Name': 'Platform',
'Value': str(platform)
},
{
'Name': 'Instance Type',
'Value': str(instance_type)
},
{
'Name': 'Num of GPUs',
'Value': 'GPUs:' + str(num_gpus)
},
{
'Name': 'Batch Size',
'Value': 'Batch Size:' + str(batch_size)
}
]
}
]
)
print(parsed_results['ap_0.95_small'])
client.put_metric_data(
Namespace='ModelOptimization',
MetricData=[
{
'MetricName': 'Precision-0.50:0.95-small',
'Value': parsed_results['ap_0.95_small'],
'Dimensions': [
{
'Name': 'Model',
'Value': 'FasterRCNN'
},
{
'Name': 'Platform',
'Value': str(platform)
},
{
'Name': 'Instance Type',
'Value': str(instance_type)
},
{
'Name': 'Num of GPUs',
'Value': 'GPUs:' + str(num_gpus)
},
{
'Name': 'Batch Size',
'Value': 'Batch Size:' + str(batch_size)
}
]
}
]
)
print(parsed_results['ap_0.95_medium'])
client.put_metric_data(
Namespace='ModelOptimization',
MetricData=[
{
'MetricName': 'Precision-0.50:0.95-medium',
'Value': parsed_results['ap_0.95_medium'],
'Dimensions': [
{
'Name': 'Model',
'Value': 'FasterRCNN'
},
{
'Name': 'Platform',
'Value': str(platform)
},
{
'Name': 'Instance Type',
'Value': str(instance_type)
},
{
'Name': 'Num of GPUs',
'Value': 'GPUs:' + str(num_gpus)
},
{
'Name': 'Batch Size',
'Value': 'Batch Size:' + str(batch_size)
}
]
}
]
)
print(parsed_results['ap_0.95_large'])
client.put_metric_data(
Namespace='ModelOptimization',
MetricData=[
{
'MetricName': 'Precision-0.50:0.95-large',
'Value': parsed_results['ap_0.95_large'],
'Dimensions': [
{
'Name': 'Model',
'Value': 'FasterRCNN'
},
{
'Name': 'Platform',
'Value': str(platform)
},
{
'Name': 'Instance Type',
'Value': str(instance_type)
},
{
'Name': 'Num of GPUs',
'Value': 'GPUs:' + str(num_gpus)
},
{
'Name': 'Batch Size',
'Value': 'Batch Size:' + str(batch_size)
}
]
}
]
)
print(parsed_results['time'])
client.put_metric_data(
Namespace='ModelOptimization',
MetricData=[
{
'MetricName': 'Training time',
'Value': parsed_results['time'],
'Dimensions': [
{
'Name': 'Model',
'Value': 'FasterRCNN'
},
{
'Name': 'Platform',
'Value': str(platform)
},
{
'Name': 'Instance Type',
'Value': str(instance_type)
},
{
'Name': 'Num of GPUs',
'Value': 'GPUs:' + str(num_gpus)
},
{
'Name': 'Batch Size',
'Value': 'Batch Size:' + str(batch_size)
}
]
}
]
)