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

pooling op pads issue #38

Open
Learneruestc opened this issue Oct 20, 2023 · 0 comments
Open

pooling op pads issue #38

Learneruestc opened this issue Oct 20, 2023 · 0 comments

Comments

@Learneruestc
Copy link

In onnx: pooling node attrbute about ceil mode:
ceil_mode: int64 Whether to use ceil or floor (default) to compute the output shape.
default is 0.
Thus in caffe-onnx-master/src/OPs/Pooling.py L36-L48 should be:

h = (input_shape[0][2] - kernel_shape[0] + pads[0] + pads[2])/strides[0] + 1
if h > int(h):
    output_shape_h = int(h) + 1
    **pads[0] += 1
    pads[2] += 1**
else:
    output_shape_h = int(h)

w = (input_shape[0][3] - kernel_shape[1] + pads[1] + pads[3])/strides[1] + 1
if w > int(w):
    output_shape_w = int(w) + 1
    **pads[1] += 1
    pads[3] += 1**
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