0

I want to use neural networks as models for do_MPC

so, As mentioned in do_MPC doc, converted the tf model to ONNX model and converted it to Casadi format with do_MPC.sysid.ONNXConversion.

Lastly, I tried to check using casadi.convert, but the error below occurred.

Exception: Operation 'Gemm' not implemented. Please consider the limited set of operations available to the tool.

this is my code:

onnx_model = onnx.load(".\dst\path\model.onnx")
casadi_converter = do_mpc.sysid.ONNXConversion(onnx_model)
print(casadi_converter)
casadi_converter.convert(input=np.ones((1,15)))

ONNX2Casadi model 'casadi_model'


Call 'convert' by supplying the inputs with respective name and shape below. Input shape of 'input' is (1, 15)

Query the instance with the following keywords to obtain the CasADi expression of the respective layer or graph operation node:

  • 'input'
  • 'model_1/dense_5/MatMul_Gemm__6:0'
  • 'model_1/dense_5/Relu:0'
  • 'model_1/dense_6/MatMul_Gemm__7:0'
  • 'model_1/dense_6/Relu:0'
  • 'model_1/dense_7/MatMul_Gemm__8:0'
  • 'model_1/dense_7/Relu:0'
  • 'model_1/dense_8/MatMul_Gemm__9:0'
  • 'model_1/dense_8/Relu:0'
  • 'dense_9'

Exception: Operation 'Gemm' not implemented. Please consider the limited set of operations available to the tool.

I'd like to know if there's an alternative way to solve this problem.

thanks

이윤형
  • 1
  • 1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jun 16 '23 at 10:15

0 Answers0