Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotImplementedError: Average pool operation with spatial rank == -2 is not implemented #202

Open
pzy2000 opened this issue Mar 15, 2024 · 0 comments

Comments

@pzy2000
Copy link

pzy2000 commented Mar 15, 2024

微信图片_20240315152906

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 (most recent call last):
File "issue_onnx2torch_001.py", line 4, 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 33, in _
) from exc
NotImplementedError: Average pool operation with spatial rank == -2 is not implemented

Code to reproduce:
from onnx2torch import convert

onnx_model_path = "vgg19-imagenet_origin-MDtype4-NLAll9-MDtype24-MDims26.onnx"
torch_model = convert(onnx_model_path)

the onnx file can be acquired at https://drive.google.com/file/d/1lfGz41_pFvQwJYsZxuPPX53dLzzWYKBx/view?usp=sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant