Possible bug with random cut forest on sagemaker

0

I am following the tutorial for random cut forest on sagemaker here: https://sagemaker-examples.readthedocs.io/en/latest/introduction_to_amazon_algorithms/random_cut_forest/random_cut_forest.html When I run this chunk of code below

from sagemaker import RandomCutForest

session = sagemaker.Session()

# specify general training job information
rcf = RandomCutForest(
    role=execution_role,
    instance_count=1,
    instance_type="ml.m4.xlarge",
    data_location=f"s3://{bucket}/{prefix}/",
    output_path=f"s3://{bucket}/{prefix}/output",
    num_samples_per_tree=512,
    num_trees=50,
)
# automatically upload the training data to S3 and run the training job
rcf.fit(rcf.record_set(taxi_data.value.to_numpy().reshape(-1, 1)))

I get this error, due to the "rcf = RandomCutForest()" line: UnknownServiceError: Unknown service: 'sagemaker-metrics'. Valid service names are: .....

A more detailed screenshot of the error is below Enter image description here Enter image description here Enter image description here

May I ask if this is a possible bug on aws sagemaker end? Or is there something wrong with the code? It was working fine until a few days ago. Thank you!

asked a year ago593 views
1 Answer
0

Hi,

Based on the stack trace, the error is thrown by Boto3, which is a low-level AWS SDK, used by SageMaker Python SDK.

This error indicates that the current Boto3 version doesn't support sagemaker-metrics, which is invoked by SageMaker Python SDK.

Just checked the lates version, sagemaker-metrics is added into support as in https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker-metrics.html

Please try to upgrade boto3 to the latest version and the error should be gone.

AWS
answered a year 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