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!

preguntada hace 2 años441 visualizaciones
1 Respuesta
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
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas