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

__class__ not set defining 'ModelSettings' error during mlserver start #1000

Closed
sabaimran opened this issue Feb 13, 2023 · 3 comments
Closed
Assignees

Comments

@sabaimran
Copy link

sabaimran commented Feb 13, 2023

Hi all! I wanted to get a quick start example going to see if mlserver was a good candidate for my use case. I ran into this issue when trying to start the server:

cmd: mlserver start .
This is the error log:

Traceback (most recent call last):
  File "/<path>/.venv/bin/mlserver", line 5, in <module>
    from mlserver.cli import main
  File "/<path>/.venv/lib/python3.10/site-packages/mlserver/__init__.py", line 2, in <module>
    from .server import MLServer
  File "/<path>/.venv/lib/python3.10/site-packages/mlserver/server.py", line 7, in <module>
    from .model import MLModel
  File "/<path>/.venv/lib/python3.10/site-packages/mlserver/model.py", line 3, in <module>
    from .codecs import (
  File "/<path>/.venv/lib/python3.10/site-packages/mlserver/codecs/__init__.py", line 1, in <module>
    from .numpy import NumpyCodec, NumpyRequestCodec
  File "/<path>//.venv/lib/python3.10/site-packages/mlserver/codecs/numpy.py", line 7, in <module>
    from .base import InputCodec, register_input_codec, register_request_codec
  File "/<path>/.venv/lib/python3.10/site-packages/mlserver/codecs/base.py", line 6, in <module>
    from ..logging import logger
  File "/<path>/.venv/lib/python3.10/site-packages/mlserver/logging.py", line 10, in <module>
    from .settings import Settings
  File "/<path>/.venv/lib/python3.10/site-packages/mlserver/settings.py", line 192, in <module>
    class ModelSettings(BaseSettings):
RuntimeError: __class__ not set defining 'ModelSettings' as <class 'mlserver.settings.ModelSettings'>. Was __classcell__ propagated to type.__new__?

Files

./settings.json

{
    "host": "0.0.0.0",
    "http_port": 5000,
    "grpc_port": 5001,
    "debug": true
}

./test-model/model-settings.json

{
    "name": "wine-classifier",
    "implementation": "mlserver_mlflow.MLflowRuntime",
    "parameters": {
        "uri": "s3://ml-training-artifacts-pg/1/model"
    }
}
@sabaimran sabaimran changed the title Issue during start __class__ not set defining 'ModelSettings' error during mlserver start Feb 13, 2023
@adriangonz
Copy link
Contributor

Hey @sabaimran ,

That's quite a strange error - I've never experienced that one myself (nor seen that reported). It could be due to a weird mix of dependency versions?

Is this a fresh environment? Could you share the output of pip freeze?

@adriangonz adriangonz self-assigned this Feb 14, 2023
@sabaimran
Copy link
Author

Hi @adriangonz! I had other dependencies installed as well. I ended up uninstalling mlserver, but I will try to recreate the environment and see if I can get a reproduction of the error.

@adriangonz
Copy link
Contributor

Hey @sabaimran ,

From what was shared in #1010, this issue may have been caused by an old version of Pydantic (<= 1.7). If you upgrade to a more recent version, it should go away.

I'll close this for now, but please do re-open if the error re-occurs after upgrading.

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

2 participants