Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load 'yolov5n.onnx'. #23

Open
miaowrx opened this issue Oct 25, 2021 · 2 comments
Open

Failed to load 'yolov5n.onnx'. #23

miaowrx opened this issue Oct 25, 2021 · 2 comments

Comments

@miaowrx
Copy link

miaowrx commented Oct 25, 2021

hi,
I try to load 'yolov5n.onnx' like this:

#include "onnx.h"

int main(void)
{
    struct onnx_context_t *sess = onnx_context_alloc_from_file("yolov5n.onnx", NULL, 0);
    onnx_context_dump(sess, 1);
    return 0;
}

but nothing was output, including warnings and errors.

@beru
Copy link
Contributor

beru commented Oct 25, 2021

I'm having similar issue with different model (in my case, the model is yolov3-tiny.onnx) .

I added ONNX_LOG calls to the onnx_graph_alloc function for debugging.

		if(!n->operator)
		{
			resolver_solve_operator(&resolver_default, n);
			if(n->operator)
			{
				n->r = &resolver_default;
				n->rctx = NULL;
			}
			else
			{
				ONNX_LOG("Unresolved!\r\n");
				ONNX_LOG("n->proto->op_type : %s\r\n", n->proto->op_type);
				ONNX_LOG("n->proto->name : %s\r\n", n->proto->name);
				ONNX_LOG("n->opset : %d\r\n", n->opset);
				ONNX_LOG("n->inputs[0]->type : %d\r\n", n->inputs[0]->type);
			}
		}
		if(!n->reshape)
			n->reshape = reshape_dummy;
		if(!n->operator) {
			n->operator = operator_dummy;
		}
		if(n->init)
		{
			if(n->init(n) <= 0)
			{
				ONNX_LOG("n->init failed\r\n");
				ONNX_LOG("i : %d\r\n", i);
				ONNX_LOG("n->proto->op_type : %s\r\n", n->proto->op_type);
				ONNX_LOG("n->proto->name : %s\r\n", n->proto->name);
				if(g->nodes)
				{

There're a few things I have noticed.

  • Resize operator is still not implemented.
  • Many operators such as Concat, input data type must be defined when resolving operators. But it looks like it's undefined before running the model.

@miaowrx miaowrx closed this as completed Oct 31, 2021
@miaowrx miaowrx reopened this Nov 16, 2021
@lzlwakeup
Copy link

I have same issue with Segmentation fault (core dumped).
model in https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB
xxd convert onnx model to .h file, load model err in onnx_graph_alloc()
in onnx.c line 1171, model g->nlen = 242, but run end 82, and Segmentation fault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants