Я пытаюсь запустить задание мониторинга SageMaker на основе данных, созданных моей моделью, но постоянно сталкиваюсь с проблемами проверки схемы. К сожалению, я не могу найти никакой документации по точной схеме, которую ожидает SageMaker.
Данные, которые он пытается проанализировать, выглядят следующим образом:
Код: Выделить всё
[{"captureData": {"endpointInput": {"observedContentType":"application/json","mode": "INPUT","data": "Some input","encoding": "JSON"},"endpointOutput": {"observedContentType": "application/json","mode": "OUTPUT","data": "Raw Output","encoding": "JSON"}},"eventMetadata": {"eventId": "abc12345-ca38-42f2-a57b-03b6bd701235","inference time": "2024-03-14T02:06:27Z"},"eventVersion": "0"}]
Код: Выделить всё
com.amazonaws.sagemaker.dataanalyzer.exception.CustomerError: We currently only support flat json at the moment.
Дополнительный контекст:
Код: Выделить всё
DataCaptureConfig
Код: Выделить всё
capture_options=["REQUEST", "RESPONSE"]
data_capture_config = DataCaptureConfig(
enable_capture=True,
sampling_percentage=100,
destination_s3_uri=s3_capture_upload_path,
capture_options=capture_options
)
Код: Выделить всё
Baseline Job
Код: Выделить всё
baseline_job = my_default_monitor.suggest_baseline(
baseline_dataset=f"{baseline_data_uri}/fake_data_augmented_with_variability.csv",
dataset_format=sagemaker.model_monitor.DatasetFormat.csv(header=True),
output_s3_uri=baseline_results_uri,
job_name=baseline_job_name,
wait=False,
logs=False
)
Код: Выделить всё
Monitoring schedule
Код: Выделить всё
my_default_monitor.create_monitoring_schedule(
monitor_schedule_name=mon_schedule_name,
endpoint_input=endpoint_name,
post_analytics_processor_script=s3_code_postprocessor_uri,
output_s3_uri=s3_report_path,
statistics=my_default_monitor.baseline_statistics(),
constraints=my_default_monitor.suggested_constraints(),
schedule_cron_expression=CronExpressionGenerator.hourly(),
enable_cloudwatch_metrics=True,
)
Код: Выделить всё
Endpoint invocation
Код: Выделить всё
response = runtime_client.invoke_endpoint(
EndpointName=endpoint_name,
ContentType="application/json",
Body=body_json
)
Источник: https://stackoverflow.com/questions/781 ... g-schedule