Skip to content

Can not compile an XGBoost 1.0 model #1616

@NukaCody

Description

@NukaCody

Is your feature request related to a problem? Please describe.
Can not compile an XGBoost model with version 1.0. I've been able to do it with previous versions but it breaks once you updgrade to a stable 1.0 branch

Describe the solution you'd like

compiled_model = xgb_estimator.compile_model(
    target_instance_family = "ml_m5",
    role = sage_exec,
    input_shape = {'data': [1, 64]},
    output_path = xgb_estimator.output_path,
    framework = "xgboost",
    framework_version = "1.0"
)

Should compile a 1.0 XGboost model when the model was trained with

container = get_image_uri(region, 'xgboost', repo_version='1.0-1')

xgb_estimator = Estimator(
    container,
    role = sage_exec,
    sagemaker_session = session,
    input_mode = 'File',
    output_path = f"s3://{bucket}{prefix}/output",
    
    train_instance_count = 2,
    train_instance_type = 'ml.m5.2xlarge',
    
    train_use_spot_instances = True,
    train_max_run = 300,
    train_max_wait = 600,
)

xgb_estimator.fit(s3_data)

Describe alternatives you've considered
None

Additional context
Trying to compile with what's above returns:

ClientError: InputConfiguration: Invalid XGBoost model. Please make sure the framework you select is correct. local variable 'model_objects' referenced before assignment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions