公式检测时间cpu才3秒,换了gpu一下30秒了,其他的话都快了很多。然后运行一会之后会报错RuntimeError: CUDA error: unspecified launch failure
Description of the bug | 错误描述
[08/09 08:35:21 d2.checkpoint.detection_checkpoint]: [DetectionCheckpointer] Loading from /home/founder/MinerU-master/MinerU-master/PDF-Extract-Kit/Layout/model_final.pth ... [08/09 08:35:21 fvcore.common.checkpoint]: [Checkpointer] Loading from /home/founder/MinerU-master/MinerU-master/PDF-Extract-Kit/Layout/model_final.pth ... 2024-08-09 08:35:23.885 | INFO | magic_pdf.model.pdf_extract_kit:init:132 - DocAnalysis init done! 2024-08-09 08:35:23.885 | INFO | magic_pdf.model.doc_analyze_by_custom_model:custom_model_init:92 - model init cost: 50.39578175544739 2024-08-09 08:35:27.275 | INFO | magic_pdf.model.pdf_extract_kit:call:143 - layout detection cost: 2.9
0: 1888x1376 8 embeddings, 21 isolateds, 114.5ms Speed: 77.4ms preprocess, 114.5ms inference, 43.1ms postprocess per image at shape (1, 3, 1888, 1376) 2024-08-09 08:35:59.737 | INFO | magic_pdf.model.pdf_extract_kit:call:173 - formula nums: 29, mfr time: 31.03 2024-08-09 08:35:59.746 | INFO | magic_pdf.model.pdf_extract_kit:call:250 - ocr cost: 0.01 2024-08-09 08:36:00.429 | INFO | magic_pdf.model.pdf_extract_kit:call:143 - layout detection cost: 0.68
0: 1888x1376 2 isolateds, 83.4ms Speed: 37.9ms preprocess, 83.4ms inference, 1.6ms postprocess per image at shape (1, 3, 1888, 1376) 2024-08-09 08:36:30.478 | INFO | magic_pdf.model.pdf_extract_kit:call:173 - formula nums: 2, mfr time: 29.91 2024-08-09 08:36:31.406 | INFO | magic_pdf.model.pdf_extract_kit:call:250 - ocr cost: 0.93 2024-08-09 08:36:31.866 | INFO | magic_pdf.model.pdf_extract_kit:call:143 - layout detection cost: 0.46
0: 1888x1376 3 embeddings, 33 isolateds, 81.1ms
Speed: 18.0ms preprocess, 81.1ms inference, 1.6ms postprocess per image at shape (1, 3, 1888, 1376)
2024-08-09 08:36:48.273 | ERROR | main:pdf_parse_main:135 - CUDA error: unspecified launch failure
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.
Traceback (most recent call last):
File "/home/founder/MinerU-master/MinerU-master/demo/magic_pdf_parse_main.py", line 224, in
File "/home/founder/MinerU-master/MinerU-master/demo/magic_pdf_parse_main.py", line 117, in pdf_parse_main pipe.pipe_analyze() # 解析 │ └ <function OCRPipe.pipe_analyze at 0x7fdd9e6beb90> └ <magic_pdf.pipe.OCRPipe.OCRPipe object at 0x7fdd91707550>
File "/home/founder/env/lib/python3.10/site-packages/magic_pdf/pipe/OCRPipe.py", line 19, in pipe_analyze
self.model_list = doc_analyze(self.pdf_bytes, ocr=True)
│ │ │ │ └ b'%PDF-1.7\r%\xe2\xe3\xcf\xd3\r\n308 0 obj\r<</Linearized 1/L 643506/O 310/E 111574/N 6/T 642787/H [ 660 557]>>\rendobj\r ...
│ │ │ └ <magic_pdf.pipe.OCRPipe.OCRPipe object at 0x7fdd91707550>
│ │ └ <function doc_analyze at 0x7fde33cd9bd0>
│ └ []
└ <magic_pdf.pipe.OCRPipe.OCRPipe object at 0x7fdd91707550>
File "/home/founder/env/lib/python3.10/site-packages/magic_pdf/model/doc_analyze_by_custom_model.py", line 113, in doc_analyze
result = custom_model(img)
│ └ array([[[255, 255, 255],
│ [255, 255, 255],
│ [255, 255, 255],
│ ...,
│ [255, 255, 255],
│ [255...
└ <magic_pdf.model.pdf_extract_kit.CustomPEKModel object at 0x7fdd91707d60>
File "/home/founder/env/lib/python3.10/site-packages/magic_pdf/model/pdf_extract_kit.py", line 168, in call
output = self.mfr_model.generate({'image': mf_img})
│ │ │ └ <unprintable Tensor object>
│ │ └ <function UniMERModel.generate at 0x7fdc2e001a20>
│ └ UniMERModel(
│ (model): DonutEncoderDecoder(
│ (model): CustomVisionEncoderDecoderModel(
│ (encoder): DonutSwinModel(
│ ...
└ <magic_pdf.model.pdf_extract_kit.CustomPEKModel object at 0x7fdd91707d60>
File "/home/founder/env/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
│ │ └ {}
│ └
RuntimeError: CUDA error: unspecified launch failure
How to reproduce the bug | 如何复现
magic_pdf_parse_main.py
Operating system | 操作系统
Linux
Python version | Python 版本
3.10
Software version | 软件版本 (magic-pdf --version)
0.6.x
Device mode | 设备模式
cuda
可能是显存不足导致的,请确认剩余显存是否大于16GB
我也有这个问题,但是我的显存剩余很充足