onnx2torch
onnx2torch copied to clipboard
Convert ONNX models to PyTorch.
Hi author, I am curious if onnx2torch supports dynamic input shape. I try to convert an onnx whose input shape is dynamic, i.e, [batch, 10, 20, 30]. The conversion looks...
 Traceback (most recent call last): File "issue_onnx2torch_002.py", line 15, in torch_model = convert(onnx_model_path) File "/opt/conda/envs/tf2onnx/lib/python3.7/site-packages/onnx2torch/converter.py", line 107, in convert version=version, File "/opt/conda/envs/tf2onnx/lib/python3.7/site-packages/onnx2torch/node_converters/registry.py", line 69, in get_converter raise NotImplementedError(f'Converter is...
Traceback (most recent call last): File "issue_onnx2torch_002.py", line 15, in torch_model = convert(onnx_model_path) File "/opt/conda/envs/tf2onnx/lib/python3.7/site-packages/onnx2torch/converter.py", line 110, in convert torch_module, onnx_mapping = converter(onnx_node, onnx_graph) File "/opt/conda/envs/tf2onnx/lib/python3.7/site-packages/onnx2torch/node_converters/average_pool.py", line 48, in _...
BUG Log: Traceback (most recent call last): File "/opt/conda/envs/tf2onnx/lib/python3.7/site-packages/onnx2torch/node_converters/average_pool.py", line 29, in _ avgpool_class = _AVGPOOL_CLASS_FROM_SPATIAL_RANK[spatial_rank] KeyError: -2 The above exception was the direct cause of the following exception: Traceback...
Hi, I'd like to know if pangu-weather forecast model can be converted to pytoch, here is the link to the pangu-moedl: https://github.com/198808xc/Pangu-Weather
Hi, I have a usecase that ingests ONNX models, and needs to convert to PyTorch then export a traced graph (via `torch.export.export()`). After converting ONNX to torch (via `onnx2torch.convert()`), I'm...
### Bug Description I encountered an issue while converting CosyVoice speech tokenizer ONNX model to PyTorch using `onnx2torch`. Specifically, the model contains a `Clip` operation where the `min` and `max`...
I have a previously exported model (`/model.onnx`) and after loading it I realized that its graph initializer list (`model.graph.initializer`) is empty because weights of Conv layers are somehow saved as...
I am trying to convert an onnx model of Mediapipe into PyTorch for editing it. However, when I try to convert it it gives the following error: ```python from onnx2torch...
Code to reproduce: ``` import onnx from onnx2torch import convert onnx_model = onnx.load("cifar10-model.onnx") model = convert(onnx_model) model(torch.randn(128, 3, 32, 32)) ``` Model to reproduce (rename .txt to .onnx): [model.txt](https://github.com/user-attachments/files/16971524/model.txt) Traceback:...