Community
cancel
Showing results for 
Search instead for 
Did you mean: 
uelor
Novice
225 Views

pooling3d operation for onnx

Hi: 
I have been trying to convert to a ONNX model to intermediate representation using model optimizer, and I have an error in the max pooling operation. This is the error: 
[ ERROR ]  operands could not be broadcast together with shapes (2,) (3,) 
looking in the model optimizer code I see that is a numpy error, in pooling.py file line  116.

output_spatial_shape = np.array(rounding( np.array(input_spatial_shape + pad_spatial_shape - window_spatial_shape, dtype=np.float) / stride_spatial), dtype=np.int64) + 1

all variables sizes are 2 except pad_spatial_shape which is 3.

So my conclusion is that the pooling.py class is developed to use MaxPooling2D and the Pytorch operation makes 3D max pooling. 
https://pytorch.org/docs/stable/_modules/torch/nn/modules/pooling.html
After digging in the ONNX conversor from Pytorch I see that the pooling3D operation is transformed to pooling operation but with the 3 dimensions of the pooling (window_x, window_y, window_z). its like MaxPool(stride_x, stride_y,stride_z). 
But in the code of pooling.py we see that is discarding this  z variable. 

I see that model optimizer can make custom operators.  But no for ONNX.

https://docs.openvinotoolkit.org/latest/_docs_MO_DG_prepare_model_customize_model_optimizer_Customiz...

So, my questions are: 
Is it implemented 3D pooling in openvino model optimizer?
Are you going to add custom operation framework for ONNx files?
Thanks in advance. 

0 Kudos
0 Replies
Reply