Skip to content

Commit 89b2c2c

Browse files
ksaurWenbing Li
authored andcommitted
fixing documentation bug (#359)
1 parent ccfd34c commit 89b2c2c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ to automatically check every converter with
5555
from onnxmltools import convert_sklearn
5656
from onnxmltools.utils import save_model
5757
from onnxconverter_common.data_types import FloatTensorType
58-
initial_type = [('float_input', FloatTensorType([1, 4]))]
58+
initial_type = [('float_input', FloatTensorType([-1, 4]))]
5959
onx = convert_sklearn(clr, initial_types=initial_type)
6060
save_model(onx, "rf_iris.onnx")
6161

docs/tutorial.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ to convert other model formats into ONNX. Here we will use
5454
from onnxmltools.utils import save_model
5555
from onnxmltools.convert.common.data_types import FloatTensorType
5656

57-
initial_type = [('float_input', FloatTensorType([1, 4]))]
57+
initial_type = [('float_input', FloatTensorType([-1, 4]))]
5858
onx = convert_sklearn(clr, initial_types=initial_type)
5959
save_model(onx, "logreg_iris.onnx")
6060

@@ -67,7 +67,9 @@ for this machine learning model.
6767
::
6868

6969
import onnxruntime as rt
70+
import numpy
7071
sess = rt.InferenceSession("logreg_iris.onnx")
72+
label_name = sess.get_outputs()[0].name
7173
input_name = sess.get_inputs()[0].name
7274

7375
pred_onx = sess.run([label_name], {input_name: X_test.astype(numpy.float32)})[0]

0 commit comments

Comments
 (0)