gpu problem #17553
Unanswered
hasnali456578
asked this question in
Q&A
gpu problem
#17553
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
i install paddle gpu verison
GPU available: True
Traceback (most recent call last):
File "/home/user/ocr/ocrv1.py", line 8, in
ocr = PaddleOCR(
File "/home/user/ocr/ocr_venv/lib/python3.10/site-packages/paddleocr/_pipelines/ocr.py", line 163, in init
super().init(**base_params)
File "/home/user/ocr/ocr_venv/lib/python3.10/site-packages/paddleocr/_pipelines/base.py", line 63, in init
self._common_args = parse_common_args(
File "/home/user/ocr/ocr_venv/lib/python3.10/site-packages/paddleocr/_common_args.py", line 45, in parse_common_args
raise ValueError(f"Unknown argument: {name}")
ValueError: Unknown argument: gpu_mem
why? new argument name gpu_mem?
from paddleocr import PaddleOCR
import paddle
import time
gpu_available = paddle.device.is_compiled_with_cuda()
print("GPU available:", gpu_available)
paddle.device.set_device('gpu')
start_load = time.time()
ocr = PaddleOCR(
use_doc_orientation_classify=False,
use_gpu=True,
device="gpu",
gpu_mem=4000,
use_doc_unwarping=False,
use_textline_orientation=False) # text detection + text recognition
ocr = PaddleOCR(use_doc_orientation_classify=True, use_doc_unwarping=True) # text image preprocessing + text detection + textline orientation classification + text recognition
ocr = PaddleOCR(use_doc_orientation_classify=False, use_doc_unwarping=False) # text detection + textline orientation classification + text recognition
ocr = PaddleOCR(
text_detection_model_name="PP-OCRv5_mobile_det",
text_recognition_model_name="PP-OCRv5_mobile_rec",
use_doc_orientation_classify=False,
use_doc_unwarping=False,
use_textline_orientation=False) # Switch to PP-OCRv5_mobile models
result = ocr.predict("1.jpg")
for res in result:
res.print()
res.save_to_img("output")
res.save_to_json("output")
end_load = time.time()
print(f"模型加载时间: {end_load - start_load:.2f} 秒")
Beta Was this translation helpful? Give feedback.
All reactions