jingsongliujing / OnnxOCR

基于PaddleOCR重构,并且脱离PaddlePaddle深度学习训练框架的轻量级OCR,推理速度超快
Apache License 2.0
661 stars 62 forks source link

yolo v8 与 onnxocr 同时加载报错显存不够问题 #18

Open achenjie opened 1 month ago

achenjie commented 1 month ago

大佬,在服务里面同时加载yolo v8 和 onnxocr 时,会报错显存问题:onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Conv node. Name:'p2o.Conv.24' Status Message: D:\a_work\1\s\onnxruntime\core\providers\cuda\cuda_call.cc:121 onnxruntime::CudaCall D:\a_work\1\s\onnxruntime\core\providers\cuda\cuda_call.cc:114 onnxruntime::CudaCall CUDA failure 2: out of memory ; GPU=0 ; hostname=DESKTOP-UK21O20 ; file=D:\a_work\1\s\onnxruntime\core\providers\cuda\cuda_allocator.cc ; line=48 ; expr=cudaMalloc((void**)&p, size);

但是,同时加载 yolo v8 和 paddleocr 就不会报这个错误。

jingsongliujing commented 1 month ago

onnxocr不建议用gpu版本的,目前还有点bug,假如要用gpu版本,可以切换master分支用v2版本的

---原始邮件--- 发件人: @.> 发送时间: 2024年7月24日(周三) 晚上10:20 收件人: @.>; 抄送: @.***>; 主题: [jingsongliujing/OnnxOCR] yolo v8 与 onnxocr 同时加载报错显存不够问题 (Issue #18)

大佬,在服务里面同时加载yolo v8 和 onnxocr 时,会报错显存问题:onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Non-zero status code returned while running Conv node. Name:'p2o.Conv.24' Status Message: D:\a_work\1\s\onnxruntime\core\providers\cuda\cuda_call.cc:121 onnxruntime::CudaCall D:\a_work\1\s\onnxruntime\core\providers\cuda\cuda_call.cc:114 onnxruntime::CudaCall CUDA failure 2: out of memory ; GPU=0 ; hostname=DESKTOP-UK21O20 ; file=D:\a_work\1\s\onnxruntime\core\providers\cuda\cuda_allocator.cc ; line=48 ; expr=cudaMalloc((void**)&p, size);

但是,同时加载 yolo v8 和 paddleocr 就不会报这个错误。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

jingsongliujing commented 1 month ago

或者尝试指定一张卡 import os os.environ['CUDA_VISIBLE_DEVICES']='1'