BADBADBADBOY / pytorchOCR

基于pytorch的ocr算法库,包括 psenet, pan, dbnet, sast , crnn
676 stars 133 forks source link

CPU only inferencing #33

Closed seekingdeep closed 3 years ago

seekingdeep commented 3 years ago

@BADBADBADBOY Hi there, i am able to install and inference successfully on my computer with gpu. But now i want to install on another computer with CPU only and detect text using DBnet and PSEnet, the issue is that it needs pycuda which requires gpu??

(pocrr) home@ubuntu:~/Desktop/pocr/pytorchOCR$ sh infer.sh 
Traceback (most recent call last):
  File "./tools/det_infer.py", line 22, in <module>
    from script.onnx_to_tensorrt import build_engine,allocate_buffers,do_inference
  File "./script/onnx_to_tensorrt.py", line 3, in <module>
    import pycuda.driver as cuda
ModuleNotFoundError: No module named 'pycuda'
BADBADBADBOY commented 3 years ago

@BADBADBADBOY Hi there, i am able to install and inference successfully on my computer with gpu. But now i want to install on another computer with CPU only and detect text using DBnet and PSEnet, the issue is that it needs pycuda which requires gpu??

(pocrr) home@ubuntu:~/Desktop/pocr/pytorchOCR$ sh infer.sh 
Traceback (most recent call last):
  File "./tools/det_infer.py", line 22, in <module>
    from script.onnx_to_tensorrt import build_engine,allocate_buffers,do_inference
  File "./script/onnx_to_tensorrt.py", line 3, in <module>
    import pycuda.driver as cuda
ModuleNotFoundError: No module named 'pycuda'

yes ,the code only support GPU ,if you want to run it on CPU,maybe you need to change something in onnx_to_tensorrt.py