PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

[bug] extra copy on gpu0 when loading the model on specific GPU

Open JJJYmmm opened this issue 8 months ago • 2 comments

🔎 Search before asking

  • [x] I have searched the PaddleOCR Docs and found no similar bug report.
  • [x] I have searched the PaddleOCR Issues and found no similar bug report.
  • [x] I have searched the PaddleOCR Discussions and found no similar bug report.

🐛 Bug (问题描述)

when using the gpu_id param to init PaddleOCR, it will have a extra copy on gpu 0.

Image

🏃‍♂️ Environment (运行环境)

  • huggingface_hub version: 0.30.2
  • Platform: Linux-5.10.134-008.12.kangaroo.al8.x86_64-x86_64-with-glibc2.35
  • Python version: 3.10.16
  • paddleocr 2.10.0
  • paddlepaddle 3.0.0
  • paddlepaddle-gpu 3.0.0

🌰 Minimal Reproducible Example (最小可复现问题的Demo)

reproduction script

from paddleocr import PaddleOCR
import torch
import paddle

# 1.
# os.environ['CUDA_VISIBLE_DEVICES'] = '1'

# 2.
# paddle.set_device('gpu:1')

ocr = PaddleOCR(
  lang='en',
  use_angle_cls=False,
  use_gpu=True,
  gpu_id=1, # 3.
  show_log=True,
  max_batch_size=1024,
  use_dilation=True,  # improves accuracy
  det_db_score_mode='slow',  # improves accuracy
  rec_batch_num=1024)

import pdb;pdb.set_trace()

JJJYmmm avatar May 07 '25 08:05 JJJYmmm

Just set os.environ['CUDA_VISIBLE_DEVICES'] = '1' without specifying gpu_id and calling set_device() works in my project.

Psychim avatar May 13 '25 07:05 Psychim

PaddleOCR has already released the 3.0 branch. You can try testing on the 3.0 branch to see if there are similar issues.

zhang-prog avatar Jun 05 '25 12:06 zhang-prog

The issue has no response for a long time and will be closed. You can reopen or new another issue if are still confused.


From Bot

TingquanGao avatar Jul 07 '25 03:07 TingquanGao