From my observations (take it with a grain of salt) I noticed the fact that the input tensor needs to be flattened when calling MXPredSetInput - maybe it works that way.
However, I experience a crash when input batch size is inferred - in my case I have a pytorch model exported as ONNX, converting it to Mxnet and serving in production via the C api from Go. When batch size is specified in training - for example an input shape of (batch_size, dim) everything works. When the shape is inferred (dim, ) then a crash triggers in production.
Here is the relevant code:
sym, params = onnx_mxnet.import_model(onnx_path)
model = mxnet.mod.Module(symbol=sym, data_names=['input_0'], context=mxnet.cpu(), label_names=None)
model.set_params(arg_params=params, aux_params=params, allow_missing=True, allow_extra=True)
var handle C.PredictorHandle
success, err := C.MXPredCreate((*C.char)(unsafe.Pointer(&symbol)),
all params look correct (symbol, shapeIdx, shapeData, keys, etc) whereas the error thrown is “no such file or directory” which is quite puzzling, symbol and params files are definitely correct/present.
Any idea from someone battling the same issue?