seldon-core icon indicating copy to clipboard operation
seldon-core copied to clipboard

SKLearn version support too low

Open Guoyoyo opened this issue 6 years ago • 3 comments

The following is my sklearn_server.yaml

apiVersion: machinelearning.seldon.io/v1alpha2
kind: SeldonDeployment
metadata:
  name: sklearn
  namespace: seldon-system
spec:
  #annotations:
  #  seldon.io/executor: "true"
  name: iris-s3
  predictors:
    - graph:
        children: []
        implementation: SKLEARN_SERVER
        modelUri: s3://mymodel
        envSecretRefName: seldon-init-container-secret
        name: classifier
      name: default
      replicas: 1

I upload a sklearn model into S3 storage. The Seldon classifier fails with ModuleNotFoundError: No module named 'sklearn.svm._classes'

Traceback (most recent call last):
  File "/opt/conda/bin/seldon-core-microservice", line 11, in <module>
    load_entry_point('seldon-core', 'console_scripts', 'seldon-core-microservice')()
  File "/microservice/python/seldon_core/microservice.py", line 288, in main
    user_object = user_class(**parameters)
  File "/microservice/SKLearnServer.py", line 23, in __init__
    self.load()
  File "/microservice/SKLearnServer.py", line 31, in load
    self._joblib = joblib.load(model_file)
  File "/opt/conda/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 605, in load
    obj = _unpickle(fobj, filename, mmap_mode)
  File "/opt/conda/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 529, in _unpickle
    obj = unpickler.load()
  File "/opt/conda/lib/python3.7/pickle.py", line 1088, in load
    dispatch[key[0]](self)
  File "/opt/conda/lib/python3.7/pickle.py", line 1376, in load_global
    klass = self.find_class(module, name)
  File "/opt/conda/lib/python3.7/pickle.py", line 1426, in find_class
    __import__(module, level=0)
ModuleNotFoundError: No module named 'sklearn.svm._classes'

I ask in the slack community, thanks Clive Cox tell me that seldon seems support sklearn v0.20.3 for now.

Guoyoyo avatar May 08 '20 08:05 Guoyoyo

@Guoyoyo currently it's quite easy to extend your own server with any desirable sklearn version. We suggest you trying doing so, and you can do so by following the custom server tutorial in the docs https://docs.seldon.io/projects/seldon-core/en/latest/servers/sklearn.html

We have explored maintaining newer versions, however it does add quite a lot of complexity for us to manage multiple versions of each library, and keep them up to date on every single release. Given it's so simple to define your own dependencies, this is the way that we suggest this being done.

axsaucedo avatar Jul 15 '20 14:07 axsaucedo

However, we should update to latest when possible.

ukclivecox avatar Jul 18 '20 15:07 ukclivecox

OK, I will try it again later, thanks for reply. Do I need to close this issue ?

Guoyoyo avatar Aug 04 '20 08:08 Guoyoyo