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
onnx_fs = convert_sklearn(model, 'lb', [('float_input', Int64TensorType(X1.shape))])
onnxmltools.utils.save_model(onnx_fs, 'lb.onnx')
sess = InferenceSession('lb.onnx')
res = sess.run('', input_feed={'float_input': X1.astype(np.int64)})
res
[[0 1 1]
[1 0 0]]
RuntimeError Traceback (most recent call last)
in
5 onnx_fs = convert_sklearn(model, 'lb', [('float_input', Int64TensorType(X1.shape))])
6 onnxmltools.utils.save_model(onnx_fs, 'lb.onnx')
----> 7 sess = InferenceSession('lb.onnx')
8 res = sess.run('', input_feed={'float_input': X1.astype(np.int64)})
9 res
~/Documents/MachineLearning/onnx_projects/onnx_env/lib/python3.6/site-packages/onnxruntime/capi/session.py in init(self, path_or_bytes, sess_options)
27
28 if isinstance(path_or_bytes, str):
---> 29 self._sess.load_model(path_or_bytes)
30 elif isinstance(path_or_bytes, bytes):
31 self._sess.read_bytes(path_or_bytes)
RuntimeError: [ONNXRuntimeError] : 1 : GENERAL ERROR : Load model from lb.onnx failed:Node:Cast Output:variable [ShapeInferenceError] Can't merge shape info. Both source and target dimension have values but they differ. Source=6 Target=2 Dimension=0
The text was updated successfully, but these errors were encountered:
X1 = np.array([[0, 1, 1], [1, 0, 0]])
model = LabelBinarizer().fit(X1)
print(model.transform(X1))
onnx_fs = convert_sklearn(model, 'lb', [('float_input', Int64TensorType(X1.shape))])
onnxmltools.utils.save_model(onnx_fs, 'lb.onnx')
sess = InferenceSession('lb.onnx')
res = sess.run('', input_feed={'float_input': X1.astype(np.int64)})
res
[[0 1 1]
[1 0 0]]
RuntimeError Traceback (most recent call last)
in
5 onnx_fs = convert_sklearn(model, 'lb', [('float_input', Int64TensorType(X1.shape))])
6 onnxmltools.utils.save_model(onnx_fs, 'lb.onnx')
----> 7 sess = InferenceSession('lb.onnx')
8 res = sess.run('', input_feed={'float_input': X1.astype(np.int64)})
9 res
~/Documents/MachineLearning/onnx_projects/onnx_env/lib/python3.6/site-packages/onnxruntime/capi/session.py in init(self, path_or_bytes, sess_options)
27
28 if isinstance(path_or_bytes, str):
---> 29 self._sess.load_model(path_or_bytes)
30 elif isinstance(path_or_bytes, bytes):
31 self._sess.read_bytes(path_or_bytes)
RuntimeError: [ONNXRuntimeError] : 1 : GENERAL ERROR : Load model from lb.onnx failed:Node:Cast Output:variable [ShapeInferenceError] Can't merge shape info. Both source and target dimension have values but they differ. Source=6 Target=2 Dimension=0
The text was updated successfully, but these errors were encountered: