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
asked 8 months ago206 views
1 Answer
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
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions