-
Notifications
You must be signed in to change notification settings - Fork 835
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
sklearn iris returns value error #389
Comments
@vincentclaes I can't replicate the issue, I've tested both Python 2 and 3 environments and the tester code works as expected. Did you follow the notebook and wrap your own image using s2i adn the seldonio/seldon-core-s2i-python3:0.4 builder image or did you make any changes? |
Hi jklaise, what i do is;
i get the first error here: |
This means that numpy is missing as a dependency. Since it should be automatically pulled in by sklearn we haven't added it to the requirements.txt, but I see you are using pipenv to create virtual environments which manages dependencies in a different way to pip/conda, so this could be the issue? Also, the IrisClassifier.py contains the model class that will load the saved model weights (.sav) after training and shouldn't be called directly, you should run the model training code provided in the notebook and then use s2i to build the docker image from IrisClassifier.py. When you work through the notebook does everything else up to the first |
@jklaise sorry i had to run the train_iris.py file instead of the IrisClassifier.py. i was confused ... so if i run the train_iris file i get a IrisClassifier.sav -> ok if i follow the jupyter notebook, everything runs fine up until the seldon-core-tester.
i use the following version: |
@vincentclaes this is rather strange, the s2i build succeeds and it looks like the docker container is running too (just to confirm, does it show up on |
the pre built image runs:
with the pre-built image i get the same output
I see that there is no older version of seldon-core available on pypi
i tested the script locally and it returns an output (a numpy array) |
Can you post the output of |
so in short i have scikit-learn == 0.19.0 the same as in the requirements.
|
Let's bypass the tester script and query the endpoint directly, could you post the output of |
@jklaise sorry for taking so long to reply! i have tried and had to add the noproxy argument
and i get the expected output! so that is great. but how do i circumvent a proxy with the seldon-core-tester? |
@jklaise one way to do this is to set
and then run the seldon-core-tester command
and i get the output
i think this will be useful for other people working in an enterprise environment :) |
I am following the tutorial sklearn iris tutorial but there goes something wrong when returning the prediction
tutorial:
https://github.com/SeldonIO/seldon-core/blob/master/examples/models/sklearn_iris/sklearn_iris.ipynb
command / output:
seldon-core-tester contract.json 0.0.0.0 5000 -p
SENDING NEW REQUEST:
{'meta': {}, 'data': {'names': [u'sepal_length', u'sepal_width', u'petal_length', u'petal_width'], 'ndarray': [[5.706, 4.111, 8.179, 1.42]]}}
Traceback (most recent call last):
File "/usr/local/bin/seldon-core-tester", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/seldon_core/tester.py", line 297, in main
run_predict(args)
File "/usr/local/lib/python2.7/dist-packages/seldon_core/tester.py", line 233, in run_predict
jresp = response.json()
File "/home/dvcl643/.local/lib/python2.7/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
The text was updated successfully, but these errors were encountered: