ENOT-AutoDL / onnx2torch

Convert ONNX models to PyTorch.
Apache License 2.0
587 stars 69 forks source link

NotImplementedError: AvgPool with non symmetrical padding is not implemented. #203

Open pzy2000 opened 6 months ago

pzy2000 commented 6 months ago

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/averagepool.py", line 48, in raise NotImplementedError('AvgPool with non symmetrical padding is not implemented.') NotImplementedError: AvgPool with non symmetrical padding is not implemented. image

running the below codes to reproduce:

import numpy as np import torch from onnx2torch import convert

def _init_input(input_shape): input_shape = list(input_shape) input_shape[0] = 10 input_shape = tuple(input_shape) input = np.random.rand(*input_shape) return input

onnx_model_path = "../autoconverter/onnx/lenet5-mnist_origin-MDtype0-MDims1-SpecialI5-MParam6-MParam30-MDtype55.onnx" torch_model = convert(onnx_model_path)