Possible bug with random cut forest on sagemaker


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(
# 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 ago600 views
1 Answer


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.

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