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!

已提問 2 年前檢視次數 441 次
1 個回答
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
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南