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
When I call to_onnx I get a runtime error Inputs and outputs should have the same type (stack trace below).
SimpleImputer should expect a FloatTensorType as its input and output type due to the transformer, but it does not.
If SimpleImputer is swapped for a StandardScaler instead, the code runs fine.
Traceback (most recent call last):
File ".\src\strategy\onnx_convert_test.py", line 36, in <module>
onx3 = to_onnx(
File ".\lib\site-packages\skl2onnx\convert.py", line 306, in to_onnx
return convert_sklearn(
File ".\lib\site-packages\skl2onnx\convert.py", line 208, in convert_sklearn
onnx_model = convert_topology(
File ".\lib\site-packages\skl2onnx\common\_topology.py", line 1532, in convert_topology
topology.convert_operators(container=container, verbose=verbose)
File ".\lib\site-packages\skl2onnx\common\_topology.py", line 1349, in convert_operators
self.call_shape_calculator(operator)
File ".\lib\site-packages\skl2onnx\common\_topology.py", line 1164, in call_shape_calculator
operator.infer_types()
File ".\lib\site-packages\skl2onnx\common\_topology.py", line 653, in infer_types
shape_calc(self)
File ".\lib\site-packages\skl2onnx\shape_calculators\imputer.py", line 39, in calculate_sklearn_imputer_output_shapes
raise RuntimeError(
RuntimeError: Inputs and outputs should have the same type <class 'onnxconverter_common.data_types.FloatTensorType'> != <class 'onnxconverter_common.data_types.DoubleTensorType'>.
The text was updated successfully, but these errors were encountered:
skl2onnx Version: 1.16.0
I have a simple model where the input is numpy.float64 and the model pipeline looks like this:
When I call
to_onnx
I get a runtime errorInputs and outputs should have the same type
(stack trace below).SimpleImputer should expect a FloatTensorType as its input and output type due to the transformer, but it does not.
If SimpleImputer is swapped for a StandardScaler instead, the code runs fine.
(For a full reproducible example, my sample code is based on the example here: http://onnx.ai/sklearn-onnx/auto_tutorial/plot_ebegin_float_double.html#casttransformer.)
The text was updated successfully, but these errors were encountered: