Ask Your Question
0

How can i load a onnx with opencv?

asked 2018-12-11 23:45:09 -0600

vealocia gravatar image

updated 2018-12-11 23:46:31 -0600

I have just convert a model from pytorch to onnx and now i want load it with opencv so that i can use it in android application. But every time i run a test code in python

net=cv2.dnn.readNetFromONNX('./model.onnx')

It got a error which said

error: OpenCV(3.4.4) /io/opencv/modules/dnn/src/onnx/onnx_importer.cpp:272: error: (-204:Requested object was not found) Blob 13 not found in const blobs in function 'getBlob'

Can anybody help me?

edit retag flag offensive close merge delete

Comments

@vealocia, Is it possible to share model.onnx?

dkurt gravatar imagedkurt ( 2018-12-12 00:44:13 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-07-28 07:50:25 -0600

paubau gravatar image

updated 2019-07-28 07:51:45 -0600

@vealocia did you verify the model:

import onnx
onnx_model = onnx.load( 'model.onnx')
onnx.checker.check_model(onnx_model)

I recently had some similar issue when the Nodes in the ONNX graph are not topologically sorted.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-12-11 23:45:09 -0600

Seen: 8,543 times

Last updated: Jul 28 '19