You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
系统环境/System Environment:
Linux HP-Z840 4.15.0-91-generic 请问能提供官方版的paddle转pb模型的脚本吗? #92~16.04.1-Ubuntu SMP Fri Feb 28 14:57:22 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
版本号/Version:Paddle:2.3.2 PaddleOCR:2.6.0.1
运行指令/Command Code:
from paddleocr import PaddleOCR
gpu_index = 1 # Index of the GPU you want to use
ocr = PaddleOCR(use_gpu=True, gpu_id=gpu_index)
完整报错/Complete Error Message:
RuntimeError Traceback (most recent call last)
/tmp/ipykernel_3336504/2513519102.py in
2
3 gpu_index = 1 # Index of the GPU you want to use
----> 4 ocr = PaddleOCR(use_gpu=True, gpu_id=gpu_index)
~/.conda/envs/cyt/lib/python3.7/site-packages/paddleocr/tools/infer/utility.py in create_predictor(args, mode, logger)
272
273 # create predictor
--> 274 predictor = inference.create_predictor(config)
275 input_names = predictor.get_input_names()
276 if mode in ['ser', 're']:
RuntimeError: ResourceExhaustedError:
Out of memory error on GPU 0. Cannot allocate 150.000000kB memory on GPU 0, 10.911255GB memory has been allocated and available memory is only 5.250000MB.
Please check whether there is any other process using GPU 0.
If yes, please stop them, or start PaddlePaddle on another GPU.
If no, please decrease the batch size of your model.
If the above ways do not solve the out of memory problem, you can try to use CUDA managed memory. The command is export FLAGS_use_cuda_managed_memory=false.
(at /paddle/paddle/fluid/memory/allocation/cuda_allocator.cc:87)
I have run nvidia-smi, it shows:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.48.07 Driver Version: 515.48.07 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... Off | 00000000:04:00.0 Off | N/A |
| 25% 44C P8 9W / 250W | 11173MiB / 11264MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA GeForce ... Off | 00000000:84:00.0 Off | N/A |
| 27% 46C P8 17W / 250W | 139MiB / 11264MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1994703 C ...a/envs/tf2_GPU/bin/python 10325MiB |
| 0 N/A N/A 3320266 C ...conda/envs/cyt/bin/python 313MiB |
| 0 N/A N/A 3336504 C ...conda/envs/cyt/bin/python 533MiB |
| 1 N/A N/A 1994703 C ...a/envs/tf2_GPU/bin/python 137MiB |
+-----------------------------------------------------------------------------+
Why can't I change to GPU 1 so that I can run my code?
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
from paddleocr import PaddleOCR
gpu_index = 1 # Index of the GPU you want to use
ocr = PaddleOCR(use_gpu=True, gpu_id=gpu_index)
RuntimeError Traceback (most recent call last)
/tmp/ipykernel_3336504/2513519102.py in
2
3 gpu_index = 1 # Index of the GPU you want to use
----> 4 ocr = PaddleOCR(use_gpu=True, gpu_id=gpu_index)
~/.conda/envs/cyt/lib/python3.7/site-packages/paddleocr/paddleocr.py in init(self, **kwargs)
499 logger.debug(params)
500 # init det_model and rec_model
--> 501 super().init(params)
502
503 def ocr(self, img, det=True, rec=True, cls=True):
~/.conda/envs/cyt/lib/python3.7/site-packages/paddleocr/tools/infer/predict_system.py in init(self, args)
44 logger.setLevel(logging.INFO)
45
---> 46 self.text_detector = predict_det.TextDetector(args)
47 self.text_recognizer = predict_rec.TextRecognizer(args)
48 self.use_angle_cls = args.use_angle_cls
~/.conda/envs/cyt/lib/python3.7/site-packages/paddleocr/tools/infer/predict_det.py in init(self, args)
135 self.postprocess_op = build_post_process(postprocess_params)
136 self.predictor, self.input_tensor, self.output_tensors, self.config = utility.create_predictor(
--> 137 args, 'det', logger)
138
139 if self.use_onnx:
~/.conda/envs/cyt/lib/python3.7/site-packages/paddleocr/tools/infer/utility.py in create_predictor(args, mode, logger)
272
273 # create predictor
--> 274 predictor = inference.create_predictor(config)
275 input_names = predictor.get_input_names()
276 if mode in ['ser', 're']:
RuntimeError: ResourceExhaustedError:
Out of memory error on GPU 0. Cannot allocate 150.000000kB memory on GPU 0, 10.911255GB memory has been allocated and available memory is only 5.250000MB.
Please check whether there is any other process using GPU 0.
If the above ways do not solve the out of memory problem, you can try to use CUDA managed memory. The command is
export FLAGS_use_cuda_managed_memory=false.(at /paddle/paddle/fluid/memory/allocation/cuda_allocator.cc:87)
I have run nvidia-smi, it shows:
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.48.07 Driver Version: 515.48.07 CUDA Version: 11.7 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 NVIDIA GeForce ... Off | 00000000:04:00.0 Off | N/A |
| 25% 44C P8 9W / 250W | 11173MiB / 11264MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
| 1 NVIDIA GeForce ... Off | 00000000:84:00.0 Off | N/A |
| 27% 46C P8 17W / 250W | 139MiB / 11264MiB | 0% Default |
| | | N/A |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=============================================================================|
| 0 N/A N/A 1994703 C ...a/envs/tf2_GPU/bin/python 10325MiB |
| 0 N/A N/A 3320266 C ...conda/envs/cyt/bin/python 313MiB |
| 0 N/A N/A 3336504 C ...conda/envs/cyt/bin/python 533MiB |
| 1 N/A N/A 1994703 C ...a/envs/tf2_GPU/bin/python 137MiB |
+-----------------------------------------------------------------------------+
Why can't I change to GPU 1 so that I can run my code?