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

GPU推理内存占用过大 #27

Closed
owllight11 opened this issue Dec 28, 2023 · 3 comments
Closed

GPU推理内存占用过大 #27

owllight11 opened this issue Dec 28, 2023 · 3 comments

Comments

@owllight11
Copy link

您好,我使用您的代码通过onnx推理yolov5实例分割,加载模型后内存占用会超过4个G,在推理时最高接近7个G,请问这个内存占用是正常的吗?

@UNeedCryDear
Copy link
Owner

确认下你的模型大小和batch size大小,一般来说不会这么大,除非你本身模型就比较大,输入图片和batch size也大。
正常的yolov5s-seg转出来的onnx,1x3x640x640输入吃个2G就差不多了

@owllight11
Copy link
Author

谢谢您的回答,应该是我这边模型的问题。
还有个想请教下您,您在readmodel中有这样一句
_OrtSession = new Ort::Session(_OrtEnv, model_path.c_str(), _OrtSessionOptions);
这里_OrtSession不需要手动释放吗?

UNeedCryDear added a commit that referenced this issue Dec 29, 2023
@UNeedCryDear
Copy link
Owner

_OrtSession要释放的,感谢提醒,已经修复这个问题了。

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