Error logging model artifacts to sagemaker experiments

0

I am trying to log file using the below code snippet

run.log_file('dummy_files/ckp.pt', name=f'ckp{epoch}.pt', is_output=True)

But I am facing the below error. Any help would be appreciated.

ClientError: An error occurred (ValidationException) when calling the UpdateTrialComponent operation: 1 validation error detected: Value 'application/vnd.snesdev-page-table' at 'outputArtifacts.ckp0.pt.member.mediaType' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[-\w]+/[-\w+]+$

Surya
질문됨 8달 전217회 조회
1개 답변
0

Hi,

Thank you for using AWS Sagemaker.

I understand that you are trying to log model artifacts to sagemaker experiments. When you try to log a file using below code snippet, you are receiving error.

run.log_file('dummy_files/ckp.pt', name=f'ckp{epoch}.pt', is_output=True)

Error

''' ClientError: An error occurred (ValidationException) when calling the UpdateTrialComponent operation: 1 validation error detected: Value 'application/vnd.snesdev-page-table' at 'outputArtifacts.ckp0.pt.member.mediaType' failed to satisfy constraint: Member must satisfy regular expression pattern: ^[-\w]+/[-\w+]+$ '''

This error occurs when the input fails to satisfy the constraints specified by an AWS service [1][2]. Please look into the following APIs for information on regular expression patterns expected by different parameter values of the API calls from the error message.

[+]https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_TrialComponentArtifact.html#sagemaker-Type-TrialComponentArtifact-MediaType

Additionally, From the above error , we can observe that it is regarding the media_type parameter regular expression pattern.

The media type of the artifact, which indicates the type of data in the artifact file. The media type consists of a type and a subtype concatenated with a slash (/) character, for example, text/csv, image/jpeg, and s3/uri. The type specifies the category of the media. The subtype specifies the kind of data.

Length Constraints: Maximum length of 64. Pattern: ^[-\w]+/[-\w+]+$

[+]https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_TrialComponentArtifact.html#sagemaker-Type-TrialComponentArtifact-MediaType [+]https://sagemaker.readthedocs.io/en/stable/experiments/sagemaker.experiments.html#sagemaker.experiments.Run.log_file

So, to overcome the error you are facing, I request you to please go through the above links and pass the values such that they are satisfying the constraints and does not have any issues.

Hope this information helps.

To further understand the issue more in depth as I have limited visibility on your setup, I'd recommend you to reachout to AWS Support by creating a support case[+] so that an engineer can investigate further and help you overcome the issue. You can also share the notebook file, scripts,dataset etc which you used , so that engineer can replicate at their end and provide you with better assistance as per your use case.

[+]Open a support case with AWS using the link: https://console.aws.amazon.com/support/home?#/case/create [+]https://aws.amazon.com/premiumsupport/faqs/

References

  1. https://docs.aws.amazon.com/sagemaker/latest/APIReference/CommonErrors.html
  2. https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_UpdateTrialComponent.html#API_UpdateTrialComponent_Errors
AWS
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠