waleedka / hiddenlayer

Neural network graphs and training metrics for PyTorch, Tensorflow, and Keras.
MIT License
1.79k stars 266 forks source link

Assertation error running example pytorch notebooks #35

Open al3xsh opened 5 years ago

al3xsh commented 5 years ago

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 commented 5 years ago

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