Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Validation error in GenericModel.save when the python version is >= 3.10 #760

Closed
4 tasks done
mayoor opened this issue Apr 8, 2024 · 2 comments
Closed
4 tasks done
Assignees

Comments

@mayoor
Copy link
Member

mayoor commented Apr 8, 2024

Oracle-ads version used

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of oracle-ads.

  • I have confirmed this bug exists on the main branch of oracle-ads.

  • I agree to follow Code of Conduct.

Description

When user ties to save the model with inference conda environment which has python version 3.10 or greater, the user gets introspection error - In runtime.yaml, the key MODEL_DEPLOYMENT.INFERENCE_PYTHON_VERSION must be set to a value of 3.6 or higher.

How to Reproduce

import pandas as pd
import numpy as np
from sklearn.datasets import fetch_openml
from sklearn.model_selection import train_test_split

import ads
import automlx as automl
from automlx import init
from ads.model import GenericModel
from ads.common.model_metadata import UseCaseType

dataset = fetch_openml(name='adult', as_frame=True)
df, y = dataset.data, dataset.target

# Several of the columns are incorrectly labeled as category type in the original dataset
numeric_columns = ['age', 'capitalgain', 'capitalloss', 'hoursperweek']
for col in df.columns:
    if col in numeric_columns:
        df[col] = df[col].astype(int)

X_train, X_test, y_train, y_test = train_test_split(df,
                                                    y.map({'>50K': 1, '<=50K': 0}).astype(int),
                                                    train_size=0.7,
                                                    random_state=0)

init(engine='local')
est = automl.Pipeline(task='classification')
est.fit(X_train, y_train)

ads.set_auth("resource_principal")
automl_model = GenericModel(estimator=est, artifact_dir="automl_model_artifact")

automl_model.prepare(inference_conda_env="automlx234_p310_cpu_x86_64_v1",
                     training_conda_env="automlx234_p310_cpu_x86_64_v1",
                     use_case_type=UseCaseType.BINARY_CLASSIFICATION,
                     X_sample=X_test,
                     force_overwrite=True)

automl_model.introspect()

What was Observed

image

What was Expected

No validation error

Version

'2.9.0'
@mayoor
Copy link
Member Author

mayoor commented Apr 8, 2024

To be closed once the changes are released to pypi

@mayoor mayoor self-assigned this Apr 8, 2024
@mayoor mayoor closed this as completed May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant