fail to mxnet to onnx #18509
Comments
Handy dandy colab notebook reproduces a similar error in ONNX Runtime, implying it's an error in the model or in the exporter. |
You can install 1.x nightly builds with
or 2.x nightly builds with
|
Just attaching the model zip to get a stable URL: model-MobileFaceNet-arcface-ms1m-refine-v1.zip |
Thanks for the reply @szha. I got the same error with 1.x and 2.x nightly using the commands you provided (notebook is updated):
|
As confirmed by @TMVector both 1.x and 2.x had such issue. I'm wondering if there's anyone would help to fix this? Thanks! |
@sandeep-krishnamurthy is this something your team could help out? |
Have you tried onnx 1.5.0? @alicera |
Hi @sandeep-krishnamurthy @szha @leezu , may I know if this is a block issue for 1.7.0. thanks? |
You can monkey patch the conversion script with from mxnet.contrib import onnx as onnx_mxnet
from mxnet.contrib.onnx.mx2onnx.export_onnx import MXNetGraph as mx_op
from mxnet.contrib.onnx.mx2onnx._op_translations import get_inputs, get_boolean_attribute_value, parse_helper, convert_string_to_list
# FUCKSHIT: 1d shape of prelu gamma is not unidirectional broadcastable!!!
@mx_op.register("LeakyReLU")
def convert_leakyrelu(node, **kwargs):
# write your own conversion code here. hint: unsqueeze the gamma |
@cloudhan would you like to open a PR with a fix? |
cause;
I convert mxnet model to onnx ,it is ok.
But when I use
onnx2trt *.onnx -o *.trt
the model is fail
env :
pip install mxnet-cu102
pip install onnx==1.3.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
model ;
https://www.dropbox.com/s/akxeqp99jvsd6z7/model-MobileFaceNet-arcface-ms1m-refine-v1.zip?dl=0
ref : https://github.com/deepinsight/insightface
mxnet to onnx code;
onnx2trt *.onnx -o *.trt
Error;
Parsing model [2020-06-08 04:45:16 ERROR] (Unnamed Layer* 10) [Parametric ReLU]: slope tensor must be unidirectional broadcastable to input tensor [2020-06-08 04:45:16 ERROR] (Unnamed Layer* 10) [Parametric ReLU]: slope tensor must be unidirectional broadcastable to input tensor [2020-06-08 04:45:16 ERROR] (Unnamed Layer* 10) [Parametric ReLU]: slope tensor must be unidirectional broadcastable to input tensor While parsing node number 5 [Conv -> "conv_2_dw_conv2d"]: ERROR: /opt/onnx-tensorrt/builtin_op_importers.cpp:463 In function importConv: [8] Assertion failed: nbSpatialDims == kernel_weights.shape.nbDims - 2
The text was updated successfully, but these errors were encountered: