Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix conversion from split 11 to split 18. (#6020)
Addresses #5222 There does not exist a Split 12 from what I can see. I believe whomever made the conversion for Split 12 to Split 13 made a mistake and intended to do so for Split 11 to Split 13? IIUC, the conversions should chain. Running this with my built ONNX changes seems to work fine ``` >>> import onnx rt onnxruntime model = onnx.load('simple_model_split.onnx') model = onnx.version_converter.convert_version(model, 18) onnx.checker.check_model(model) # success sess = onnxruntime.InferenceSession(model.SerializeToString()) # fail>>> import onnxruntime >>> model = onnx.load('simple_model_split.onnx') >>> model = onnx.version_converter.convert_version(model, 18) >>> onnx.checker.check_model(model) # success >>> sess = onnxruntime.InferenceSession(model.SerializeToString()) # fail >>> >>> sess <onnxruntime.capi.onnxruntime_inference_collection.InferenceSession object at 0x7f82dcce0a30> >>> >>> import onnxruntime as rt >>> import numpy as np >>> model_serialized = model.SerializeToString() >>> sess = rt.InferenceSession(model_serialized) >>> dummy_input = np.random.randn(1, 1, 28, 28).astype(np.float32) Perfo>>> >>> outputs = sess.run(output_names=['output1', 'output2'], ... input_feed={'input': dummy_input}) >>> print(outputs) [array([[[[ 4.02100086e-01, 1.91692543e+00, 5.60453236e-01, ..., 1.10894358e+00, -9.10616279e-01, 2.63174176e-01], [ 9.16809678e-01, 8.39324117e-01, 1.30101681e+00, ..., -6.86384559e-01, 8.50693703e-01, -2.23367453e-01], [ 9.90843654e-01, 1.80581224e+00, -6.30877018e-01, ..., -4.17214930e-02, 9.42695260e-01, -9.54421163e-01], ``` Inferencing seems to work. I should remove the old split 12-> 13 converters but I would like confirmation from a contributor before I move forward. --------- Signed-off-by: Danial Javady <danialjavady96@gmail.com>
- Loading branch information