SageMaker XGBoost batch transform AttributeError

0

Hi,

After training XGBoost model using SageMaker inbuilt algorithm, I am trying to perform batch transform operation. I am doing the same steps as for linear learner model which worked fine there. However in case of XGBoost I get a following error while creating a transformer:

AttributeError: module 'sagemaker' has no attribute 'utils'

The piece of code causing the error is:

xgb_transformer = xgb_estimator.transformer(
    instance_count = 1, 
    instance_type = 'ml.m4.10xlarge',
    output_path = '{}/{}'.format(output_path,'output')
)

I use '1.5-1' version of XGBoost as image in training, and 2.86.2 version of SageMaker.

Any help would be highly appreciated!

asked 2 years ago432 views
1 Answer
0

I have tried replicating the issue and by updating the SageMaker Package to the latest version sagemaker-2.99.0 I did not find any issues creating the batch transform job. Requesting you to update the sagemaker package to the latest version and let us know if you continue to face the issue.

!pip3 install -U sagemaker

If you continue to face the issue I would encourage you to open a support ticket with AWS along with the sample code, the training job and the batch transform job ARN. Due to security reason, this post is not suitable for sharing customer's resource.

References:

[1] https://sagemaker-examples.readthedocs.io/en/latest/aws_sagemaker_studio/sagemaker_studio_image_build/xgboost_bring_your_own/Batch_Transform_BYO_XGB.html

[2] https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_applying_machine_learning/xgboost_customer_churn/xgboost_customer_churn.ipynb

AWS
answered 2 years 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