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

MLFlow model with Array type in signature not loading #1802

Open
wbinek opened this issue Jun 12, 2024 · 0 comments
Open

MLFlow model with Array type in signature not loading #1802

wbinek opened this issue Jun 12, 2024 · 0 comments

Comments

@wbinek
Copy link

wbinek commented Jun 12, 2024

I was trying to serve a model in MLFlow Model format created using MLFlow > 2.10. The MLFLow 2.10 added support for Array and Object datatypes in signature (https://www.mlflow.org/docs/latest/model/signatures.html), which seems to be unsupported by the MLServer.

Error:

2024-06-12 08:10:45,410 [mlserver.parallel] ERROR - An error occurred processing a model update of type 'Load'.
Traceback (most recent call last):
  File "/opt/conda/lib/python3.10/site-packages/mlserver/parallel/worker.py", line 158, in _process_model_update
    await self._model_registry.load(model_settings)
  File "/opt/conda/lib/python3.10/site-packages/mlserver/registry.py", line 293, in load
    return await self._models[model_settings.name].load(model_settings)
  File "/opt/conda/lib/python3.10/site-packages/mlserver/registry.py", line 148, in load
    await self._load_model(new_model)
  File "/opt/conda/lib/python3.10/site-packages/mlserver/registry.py", line 165, in _load_model
    model.ready = await model.load()
  File "/opt/conda/lib/python3.10/site-packages/mlserver_mlflow/runtime.py", line 159, in load
    self._sync_metadata()
  File "/opt/conda/lib/python3.10/site-packages/mlserver_mlflow/runtime.py", line 171, in _sync_metadata
    self.inputs = to_metadata_tensors(
  File "/opt/conda/lib/python3.10/site-packages/mlserver_mlflow/metadata.py", line 57, in to_metadata_tensors
    datatype, content_type = _get_content_type(input_spec)
  File "/opt/conda/lib/python3.10/site-packages/mlserver_mlflow/metadata.py", line 41, in _get_content_type
    return _MLflowToContentType[input_spec.type]
TypeError: unhashable type: 'Array'
2024-06-12 08:10:45,411 [mlserver] INFO - Couldn't load model 'mlflow-model'. Model will be removed from registry.

MLFlow Model Signature:

signature:
  inputs: '[{"type": "datetime", "name": "start", "required": true}, 
            {"type": "array", "items": {"type": "array", "items": {"type": "long"}}, "name": "target", "required": true}, 
            {"type": "array", "items": {"type": "string"}, "name": "feat_static_cat", "required": true}, 
            {"type": "array", "items": {"type": "array", "items": {"type": "boolean"}}, "name": "feat_dynamic_real", "required": true}]'
  outputs: null
  params: null
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