-
Hi, I'm trying to deploy a simple KMeans algorithm using BentoML.
The following script creates a simple IrisClassifier image using a KMeans algorithm:
And the serving is ok:
But when I call Can someone help me? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@Berna4 Thanks for reporting This error is due to how BentoML is loading SKLearn model with Since Sklearn model can be persist with pickle, we can use the # iris_clasifier.py
...
# from bentoml.frameworks.sklearn import SklearnModelArtifact
from bentoml.service.artifact.common import PIckleArtifact
...
@artifacts([PickleArtifact('model')])
class IrisClassifier(BentoService):
@api(...)
def predict(self, df):
... |
Beta Was this translation helpful? Give feedback.
@Berna4 Thanks for reporting
This error is due to how BentoML is loading SKLearn model with
joblib
library. Right now, BentoML is loading withmmap_mode
tor
, and that caused theread-only
issue.Since Sklearn model can be persist with pickle, we can use the
PickleArtifacts
. For now you can change theiris_classifier.py
with thebentoml.service.artifacts.common.PickleArtifact