You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue refers to the 'Deploying Machine Learning Models using kubectl' Jupyter Notebook (notebooks/kubectl_demo_minikube.ipynb) run under Python 3 (rather than 2). It was tested in Python 3.5 with Minikube 0.25.0 installation (KVM virtualization) running on Ubuntu 16.04 LTS.
Eventually I managed to get responses from the REST API, obtaining predictions for the model deployed in the notebook (seldonio/mock_classifier:1.0 /notebooks/resources/model.json). However, some dependencies were initially missing that required modification before the code could be executable in Python 3.x
Two modules from the 'proto' library were unavailable or not exposed, raising this error:
ImportError Traceback (most recent call last)
<ipython-input-42-f18b8a6f5241> in <module>()
3 # import proto
4 from proto import prediction_pb2
----> 5 from proto import prediction_pb2_grpc
6 import grpc
7 # import commands
~/Documents/python/seldon/seldon-core/notebooks/proto/prediction_pb2_grpc.py in <module>()
2 import grpc
3
----> 4 import prediction_pb2 as prediction__pb2
5
6
ImportError: No module named 'prediction_pb2'
This issue can be solved by replacing the specific modules with the entire 'proto' library:
import proto
# from proto import prediction_pb2
# from proto import prediction_pb2_grpc
The 'commands' module has been deprecated and removed from Python 3.x (link). Trying to use it in Python 3.x will cause this error message:
ImportError Traceback (most recent call last)
<ipython-input-44-f4c737095fff> in <module>()
5 # from proto import prediction_pb2_grpc
6 import grpc
----> 7 import commands
8 # import subprocess
9
ImportError: No module named 'commands'
This issue can be solved by replacing all references to this module in the Notebook with its successor module 'subprocess' (which has compatible function names), leaving a code like this:
Thanks for reporting this. The code that generates the pb2 files in notebooks/Makefile needs to be updated to make them compatible with python 3. This has been done in wrappers/Makefile but we forgot this one. We will fix that and then you should be able to import them without a problem.
We will also replace commands with subprocess like you did.
This issue refers to the 'Deploying Machine Learning Models using kubectl' Jupyter Notebook (notebooks/kubectl_demo_minikube.ipynb) run under Python 3 (rather than 2). It was tested in Python 3.5 with Minikube 0.25.0 installation (KVM virtualization) running on Ubuntu 16.04 LTS.
Eventually I managed to get responses from the REST API, obtaining predictions for the model deployed in the notebook (seldonio/mock_classifier:1.0 /notebooks/resources/model.json). However, some dependencies were initially missing that required modification before the code could be executable in Python 3.x
This issue can be solved by replacing the specific modules with the entire 'proto' library:
This issue can be solved by replacing all references to this module in the Notebook with its successor module 'subprocess' (which has compatible function names), leaving a code like this:
Collecting the above corrections produces a code that executes cleanly in Python 3.x and we finally get our predictions from the server:
However, all gRPC requests fail due to the missing 'prediction_pb2_grpc' module:
The text was updated successfully, but these errors were encountered: