Skip to content

转换的onnx模型不能加载 #1

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

Open
abc67ok opened this issue Sep 28, 2024 · 1 comment
Open

转换的onnx模型不能加载 #1

abc67ok opened this issue Sep 28, 2024 · 1 comment

Comments

@abc67ok
Copy link

abc67ok commented Sep 28, 2024

你好,感谢分享,我编译并运行main程序,按照你的步骤转换得到onnx模型,但是不能加载模型:
Using Onnxruntime C++ API
Number of inputs = 1
Input 0 : name=l_x_
Input 0 : type=float
Input 0 : num_dims=4
Input 0 : dim 0=1
Input 0 : dim 1=3
Input 0 : dim 2=-1
Input 0 : dim 3=-1
terminate called after throwing an instance of 'Ort::Exception'
what(): tried creating tensor with negative value in shape
Aborted(核心已转储)

请问你是否可以正确加载模型呢,或者你的模型转换过程是什么样的?

@WeisonWEileen
Copy link
Owner

WeisonWEileen commented Oct 3, 2024

你好,报错显示你的模型的shape是负数,大概率是模型转换出错的问题。请参照https://github.com/fabio-sim/Depth-Anything-ONNX/tree/main 进行模型转换。

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

2 participants