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

Assertation error running example pytorch notebooks #35

Open
al3xsh opened this issue Apr 18, 2019 · 1 comment
Open

Assertation error running example pytorch notebooks #35

al3xsh opened this issue Apr 18, 2019 · 1 comment

Comments

@al3xsh
Copy link

al3xsh commented Apr 18, 2019

Hi,

I get the following error when I try and run your example pytorch notebooks:

~/code/development_tools/anaconda3/envs/fastai/lib/python3.7/site-packages/torch/onnx/symbolic.py in adaptive_avg_pool2d(g, input, output_size)
    598 @parse_args('v', 'is')
    599 def adaptive_avg_pool2d(g, input, output_size):
--> 600     assert output_size == [1, 1], "Only output_size=[1, 1] is supported"
    601     return g.op("GlobalAveragePool", input)
    602 

AssertionError: Only output_size=[1, 1] is supported

I haven't modified anything, and I wonder if you have any idea what the source of this error is?

Regards,

Alex

@v1093
Copy link

v1093 commented Sep 12, 2019

Hi,

I get the following error when I try and run your example pytorch notebooks:

~/code/development_tools/anaconda3/envs/fastai/lib/python3.7/site-packages/torch/onnx/symbolic.py in adaptive_avg_pool2d(g, input, output_size)
    598 @parse_args('v', 'is')
    599 def adaptive_avg_pool2d(g, input, output_size):
--> 600     assert output_size == [1, 1], "Only output_size=[1, 1] is supported"
    601     return g.op("GlobalAveragePool", input)
    602 

AssertionError: Only output_size=[1, 1] is supported

I haven't modified anything, and I wonder if you have any idea what the source of this error is?

Regards,

Alex

For me, downgrading torchvision from 0.2.2 to 0.2.1 worked.
So basically, torchvision 0.2.2 has an AdaptiveAvgPool2d instead of AvgPool2d in AlexNet.
It was mentioned in PyTorch discussions page: https://discuss.pytorch.org/t/when-using-torch-onnx-export-errors-occurs-assertionerror-only-output-size-1-1-is-supported/38528/3

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