Can not load onnx model with opset_version=14
See original GitHub issueThank for your great repo. I have problem with load model. Here my step by step
I convert onnx model successful
torch.onnx.export(model, dummy_input, model_path, verbose=False, input_names=['input'], output_names=['output'], opset_version=14)
but when I load onn model, I get error:
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "onnxruntime/capi/onnxruntime_inference_collection.py", line 358, in _create_inference_session
sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : Load model from weights/model.onnx failed:This is an invalid model. Type Error: Type 'tensor(bool)' of input parameter (5287) of operator (CumSum) in node (CumSum_2919) is invalid.
Thank for your respone.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
use v1.9.0 to load ONNX Opset 15 failed. #9418 - GitHub
I'm not sure it's loading ORT from the 1.9.0 version. I did a test and was able to successfully load a model I...
Read more >ONNX Runtime compatibility
All versions of ONNX Runtime support ONNX opsets from ONNX v1.2.1+ (opset version 7 and higher). For example: if an ONNX Runtime release...
Read more >What is the opset number? — sklearn-onnx 1.11.2 ...
The runtime used to deploy the model does not implement a new version, in that case, a model must be converted by usually...
Read more >ValueError: Unsupported ONNX opset version: 13
Install or upgrade PyTorch 1.8.0 and OnnxRuntime 1.7.0 for CPU-only. I inserted a new cell right after: pip install torch==1.10.0 # latest.
Read more >ONNX versions and Windows builds | Microsoft Learn
In this article. ONNX opset converter. Windows Machine Learning supports specific versions of the ONNX format in released Windows builds.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you for providing the details and I can repro this issue. I think it should be an issue in the exporter (torch.onnx.export), because CumSum does not allow bool as an input but it gets input from previous Equal op, which only outputs bool. The exporter should handle this by something like using a Cast op in the middle. Please raise this issue there (under PyTorch repo) to let exporter experts be aware of it.
Close here since it has been tracked in the exporter instead. Feel free to reopen it if you still other ONNX questions. Thanks!