Error in trying to register to Saved Model with prediction type 'OTHER'

georgeannie
georgeannie Registered Posts: 3 ✭✭✭

Hi

I am trying to follow the MLOps Best practices to deploy a model in production. I am trying register a model after adding the model in experiment tracking. The model has been added in experiment tracking successfully as a 'OTHER' model using the below syntax

mlflow.pyfunc.log_model(
artifact_path=f"model_age}",
python_model=CustomWrapper(),
artifacts={"model": 'model.pkl'}
)
mlflow_extension = project.get_mlflow_extension()
mlflow_extension.set_run_inference_info(run_id=run.info.run_id,
prediction_type='OTHER',
code_env_name='Custom')

Following MLOps, the intent is to compare the model logged in experiment tracking with the previous metric in saved model.

For testing I just want to register the model from experiment tracking to saved model. Here is the code I used:

SAVED_MODEL_ID = None
for sm in project.list_saved_models():
if run_name != sm["name"]:
continue
else:
SAVED_MODEL_ID = sm["id"]
print(
"Found SavedModel {} with id {}".format(
run_name, SAVED_MODEL_ID))
break
if SAVED_MODEL_ID:
sm = project.get_saved_model(SAVED_MODEL_ID)
else:
sm = project.create_mlflow_pyfunc_model(
name=run_name,
prediction_type="OTHER")

# Deploy MLflow model as a saved model version
if len(sm.list_versions()) == 0:
version_id = "V1"
else:
max_version_num = max([int(v['id'][1:]) for v in sm.list_versions()])
version_id = f"V{max_version_num+1}"
# Create version in SavedModel
mlflow_extension.deploy_run_model(
run_id=run.info.run_id,
sm_id=sm.id,
version_id=version_id
)

The above code returns error -

DataikuException: com.dataiku.dip.io.SocketBlockLinkKernelException: Could not run command READ_META: : <class 'EOFError'> :

Would appreciate any leads to fix this error.

Operating system used: Windows

Operating system used: Windows

Operating system used: Windows

Setup Info
    Tags
      Help me…