0

I'm trying to launch model R100 (mxnet) from here:
https://github.com/deepinsight/insightface/tree/master/model_zoo
I converted it to onnx with that:

sym = './model-symbol.json'
params = './model-0000.params'
input_shape = (1,3,112,112)
onnx_file = './R100_mxnet.onnx'
converted_model_path = onnx_mxnet.export_model(sym, params, [input_shape], np.float32, onnx_file)

This check is passed:

model_proto = onnx.load_model('./R100_mxnet.onnx')
checker.check_graph(model_proto.graph)

But when I try to inference with:

classifier.run(None, {'data': np.ones([1, 3, 112, 112]).astype('float32')})[0].shape

I get:

~/.local/lib/python3.6/site-packages/onnxruntime/capi/onnxruntime_inference_collection.py in run(self, output_names, input_feed, run_options)
    190             output_names = [output.name for output in self._outputs_meta]
    191         try:
--> 192             return self._sess.run(output_names, input_feed, run_options)
    193         except C.EPFail as err:
    194             if self._enable_fallback:

Fail: [ONNXRuntimeError] : 1 : FAIL : Non-zero status code returned while running PRelu node. Name:'conv_1_relu' Status Message: conv_1_relu: left operand cannot broadcast on dim 3 LeftShape: {1,64,56,56}, RightShape: {64}

Is it an error with exporting or with importing and can I fix it?

Dmitry
  • 160
  • 9

1 Answers1

0

Fixed by pasting "#fix PRelu issue" part from here:
https://github.com/deepinsight/insightface/blob/master/examples/mxnet_to_onnx.py

Dmitry
  • 160
  • 9