You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2019/09/18 15:29:54 UTC

[GitHub] [incubator-mxnet] hfassold opened a new issue #16200: ONNX export does not work for EfficientNet model due to missing operator (AdaptiveAvgPooling2D)

hfassold opened a new issue #16200: ONNX export does not work for EfficientNet model due to missing operator (AdaptiveAvgPooling2D)
URL: https://github.com/apache/incubator-mxnet/issues/16200
 
 
   I am trying to convert the 'EfficientNet' pre-trained model (B0 variant) to ONNX format.
   See paper https://arxiv.org/abs/1905.11946
   
   Unfortunately, this does not work because it seems that one operator is missing.
   The error thrown is 'AttributeError: No conversion function registered for op type _contrib_AdaptiveAvgPooling2D yet'
   
   MXNet version: 1.5.0
   
   Code to reproduce this issue:
   
   import numpy as np
   import gluoncv2
   from gluoncv2.model_provider import get_model as glcv2_get_model
   import mxnet as mx
   from mxnet.contrib import onnx as onnx_mxnet
   effnetb0 = glcv2_get_model("efficientnet_b0", pretrained=True)
   input_shape = (1, 3, 224, 224)
   x = mx.nd.zeros(input_shape, ctx=mx.cpu())
   effnetb0.hybridize()
   y = effnetb0(x)
   effnetb0.export('effnetb0')
   converted_model_path = onnx_mxnet.export_model('effnetb0-symbol.json', 'effnetb0-0000.params', [input_shape], np.float32, 'effnetb0.onnx', verbose = True)
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services