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

ValueError: padding should have 3 elements. Received: [0]. #153

Open
Eien9 opened this issue Sep 30, 2022 · 1 comment
Open

ValueError: padding should have 3 elements. Received: [0]. #153

Eien9 opened this issue Sep 30, 2022 · 1 comment

Comments

@Eien9
Copy link

Eien9 commented Sep 30, 2022

i was trying to export .onnx file to .h5 file
i don't konw how to solve this error

DEBUG:onnx2keras:Output TF Layer -> KerasTensor(type_spec=TensorSpec(shape=(None, 128, 42), dtype=tf.float32, name=None), name='input.1/transpose_1:0', description="created by layer 'input.1'")
DEBUG:onnx2keras:######
DEBUG:onnx2keras:...
DEBUG:onnx2keras:Converting ONNX operation
DEBUG:onnx2keras:type: Relu
DEBUG:onnx2keras:node_name: onnx::MaxPool_16
DEBUG:onnx2keras:node_params: {'change_ordering': False, 'name_policy': None}
DEBUG:onnx2keras:...
DEBUG:onnx2keras:Check if all inputs are available:
DEBUG:onnx2keras:Check input 0 (name input.1).
DEBUG:onnx2keras:... found all, continue
DEBUG:onnx2keras:######
DEBUG:onnx2keras:...
DEBUG:onnx2keras:Converting ONNX operation
DEBUG:onnx2keras:type: MaxPool
DEBUG:onnx2keras:node_name: input.4
DEBUG:onnx2keras:node_params: {'kernel_shape': [2], 'pads': [0, 0], 'strides': [2], 'change_ordering': False, 'name_policy': None}
DEBUG:onnx2keras:...
DEBUG:onnx2keras:Check if all inputs are available:
DEBUG:onnx2keras:Check input 0 (name onnx::MaxPool_16).
DEBUG:onnx2keras:... found all, continue
WARNING:onnx2keras:maxpool:Unable to use same padding. Add ZeroPadding2D layer to fix shapes.
Traceback (most recent call last):
File "f:/vscode_workspace/model_output/to_onnx.py", line 101, in
onnx_to_h5(input_path, output_path) #将onnx模型转换为h5模型
File "f:/vscode_workspace/model_output/to_onnx.py", line 54, in onnx_to_h5
k_model = onnx_to_keras(onnx_model, ['input'])
File "D:\miniconda\envs\d2l\lib\site-packages\onnx2keras\converter.py", line 178, in onnx_to_keras
AVAILABLE_CONVERTERS[node_type](
File "D:\miniconda\envs\d2l\lib\site-packages\onnx2keras\pooling_layers.py", line 50, in convert_maxpool
padding_layer = keras.layers.ZeroPadding3D(
File "D:\miniconda\envs\d2l\lib\site-packages\keras\layers\reshaping\zero_padding3d.py", line 94, in init
raise ValueError(
ValueError: padding should have 3 elements. Received: [0].

@BGG19
Copy link

BGG19 commented Apr 3, 2023

hey, I've got the same problem now. Did you find any way to fix it ?

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

2 participants