microsoft / microsoft/onnxruntime

Doesn't support non-tensor output with sklearn-onnx in onnxruntime server

Open
#4,294 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

contributions welcome core runtime feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 11h
Merged PRs (30d)
184

Description

**Describe the bug**
A sklearn randomforest model converted to onnx with convert_sklearn() throws following error with API based inference:
`[error] MLValueToTensorProto() failed. Output name: output_probability. Error Message: Don't support Non-Tensor values`
While it works fine with python onnxruntime.InferenceSession()

**Urgency**
There is a use-cased being blocked due to this issue. Timelines for model deployment in onnxruntime is suppose to be EOBW

**System information**
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
- ONNX Runtime installed from (source or binary): binary
- ONNX Runtime version: 1.0.0
- Python version: 3.7
- Visual Studio version (if applicable):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version:
- GPU model and memory:

**To Reproduce**
Follow the steps till creating onnx model from sklearn randomforest (iris dataset) given in official documentation: http://onnx.ai/sklearn-onnx/
Use the onnx model in onnxruntime for inference.

**Expected behavior**
The output_probability from sklearn model converted to onnx should be a tensor by default

**Screenshots**

**Additional context**
Add any other context about the problem here. If the issue is about a particular model, please share the model details as well to facilitate debugging.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the sklearn random forest conversion from the sklearn-onnx documentation with ONNX Runtime 1.0.0, comparing Python InferenceSession with API-based inference. Start at the MLValueToTensorProto failure for output_probability; done means the converted model's output is accepted by API inference as a tensor.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, scikit-learn
Domain
api, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.