Ci Leong
Ci Leong

Reputation: 92

LightGBM Cannot be Imported in SageMaker "lightgbm-classification-model" Entry Point Script (Script Mode)

The following is the definition of an Estimator in a SageMaker Pipeline.

IMAGE_URI = sagemaker.image_uris.retrieve(
    framework=None,
    region=None,
    instance_type="ml.m5.xlarge",
    image_scope="training",
    model_id="lightgbm-classification-model",
    model_version="2.1.3",
)

hyperparams = hyperparameters.retrieve_default(
    model_id="lightgbm-classification-model",
    model_version="2.1.3",
)

lgb_estimator = Estimator(
    image_uri=IMAGE_URI,
    role=ROLE,
    instance_count=1,
    instance_type="ml.m5.xlarge",
    sagemaker_session=pipeline_session,
    hyperparameters=hyperparams,
    entry_point="src/train.py",
)

In train.py:

import lightgbm

When the pipeline is executed, this error is observed:

ModuleNotFoundError
 : No module named 'lightgbm'

There is no official documentation on "lightgbm-classification-model". What are the expected inputs/outputs/functions/function signatures in the entry point script, train.py?

Upvotes: 0

Views: 31

Answers (0)

Related Questions