Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken pipe error #295

Open
Dieterbe opened this issue Oct 5, 2024 · 4 comments
Open

Broken pipe error #295

Dieterbe opened this issue Oct 5, 2024 · 4 comments

Comments

@Dieterbe
Copy link

Dieterbe commented Oct 5, 2024

i'm seeing a lot of broken pipe errors. it was preceeded by a process getting killed
(see output below). perhaps it's just too much data all at once (23 pdf files that are all 60-130 pages long), on a system with 32GB RAM.
i'll try to do it doc by doc in a script, instead.

marker ptc ptc-docs                                                                                                    ✘ 130 
Loaded detection model vikp/surya_det3 on device cpu with dtype torch.float32
Loaded detection model vikp/surya_layout3 on device cpu with dtype torch.float32
Loaded reading order model vikp/surya_order on device cpu with dtype torch.float32
Loaded recognition model vikp/surya_rec2 on device cpu with dtype torch.float32
Loaded texify model to cpu with torch.float32 dtype
Converting 23 pdfs in chunk 1/1 with 5 processes, and storing in /home/dieter/code/ptc/resources/ptc-docs
Detecting bboxes:   0%|                                                                                                                                                                       | 0/33 [00:00<?, ?it/s][1]    116981 killed     marker ptc ptc-docs
Detecting bboxes: 100%|███████████████████████████████████████████████████████████████████████████████████
Recognizing Text: 100%|███████████████████████████████████████████████████████████████████████████████████
Detecting bboxes: 100%|███████████████████████████████████████████████████████████████████████████████████
Detecting bboxes: 100%|███████████████████████████████████████████████████████████████████████████████████
Detecting bboxes:  53%|███████████████████████████████████████████████████████████████████████████████████▏                                                                          | 20/38 [07:17<04:16, 14.27s/itDetecting bboxes:  55%|███████████████████████████████████████████████████████████████████████████████████████▎                                                                      | 21/38 [07:32<04:05, 14.45s/itDetecting bboxes:  58%|███████████████████████████████████████████████████████████████████████████████████████████▍                                                                  | 22/38 [07:49<04:02, 15.16s/itDetecting bboxes:  61%|███████████████████████████████████████████████████████████████████████████████████████████████▋                                                              | 23/38 [08:05<03:53, 15.58s/itDetecting bboxes:  63%|███████████████████████████████████████████████████████████████████████████████████████████████████▊                                                          | 24/38 [08:24<03:50, 16.47s/itDetecting bboxes:  66%|███████████████████████████████████████████████████████████████████████████████████████████████████████▉                                                      | 25/38 [08:40<03:33, 16.42s/itDetecting bboxes:  68%|████████████████████████████████████████████████████████████████████████████████████████████████████████████                                                  | 26/38 [08:57<03:18, 16.54s/itDetecting bboxes:  71%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎                                             | 27/38 [09:13<03:01, 16.51s/itDetecting bboxes:  74%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▍                                         | 28/38 [09:31<02:47, 16.79s/itDetecting bboxes:  76%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌                                     | 29/38 [09:48<02:31, 16.88s/itDetecting bboxes:  79%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋                                 | 30/38 [10:05<02:14, 16.82s/itDetecting bboxes:  82%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▉                             | 31/38 [10:24<02:02, 17.47s/itDetecting bboxes:  84%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████                         | 32/38 [10:40<01:42, 17.17s/itDetecting bboxes:  87%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▏                    | 33/38 [10:56<01:23, 16.78s/itDetecting bboxes:  89%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▎                | 34/38 [11:13<01:07, 16.82s/itDetecting bboxes:  92%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▌            | 35/38 [11:33<00:53, 17.89s/itDetecting bboxes:  95%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▋        | 36/38 [11:49<00:34, 17.35s/itDetecting bboxes:  97%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊    | 37/38 [12:05<00:16, 16.69s/itDetecting bboxes: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 38/38 [12:10<00:00, 13.38s/itDetecting bboxes: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 38/38 [12:10<00:00, 19.23s/it]
Recognizing Text: 100%|█████████████████████████████████████████████████████| 7/7 [09:03<00:00, 77.58s/it]
Detecting bboxes: 100%|███████████████████████████████████████████████████| 13/13 [03:50<00:00, 17.74s/it]
Recognizing Text: 100%|███████████████████████████████████████████████████| 20/20 [21:13<00:00, 63.68s/it]
Finding reading order: 100%|██████████████████████████████████████████████| 13/13 [07:46<00:00, 35.89s/it]
Recognizing Text:  43%|█████████████████████▊                             | 15/35 [16:04<25:26, 76.32s/it]Process SpawnPoolWorker-2:
Traceback (most recent call last):
  File "/usr/lib/python3.12/multiprocessing/pool.py", line 131, in worker
    put((job, i, result))
  File "/usr/lib/python3.12/multiprocessing/queues.py", line 399, in put
    self._writer.send_bytes(obj)
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 200, in send_bytes
    self._send_bytes(m[offset:offset + size])
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 427, in _send_bytes
    self._send(header + buf)
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 384, in _send
    n = write(self._handle, buf)
        ^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.12/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.12/multiprocessing/pool.py", line 136, in worker
    put((job, i, (False, wrapped)))
  File "/usr/lib/python3.12/multiprocessing/queues.py", line 399, in put
    self._writer.send_bytes(obj)
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 200, in send_bytes
    self._send_bytes(m[offset:offset + size])
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 427, in _send_bytes
    self._send(header + buf)
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 384, in _send
    n = write(self._handle, buf)
        ^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe
Detecting bboxes: 100%|███████████████████████████████████████████████████| 13/13 [02:39<00:00, 12.27s/it]
Finding reading order: 100%|██████████████████████████████████████████████| 13/13 [04:48<00:00, 22.16s/it]
Process SpawnPoolWorker-3:
Traceback (most recent call last):
  File "/usr/lib/python3.12/multiprocessing/pool.py", line 131, in worker
    put((job, i, result))
  File "/usr/lib/python3.12/multiprocessing/queues.py", line 399, in put
    self._writer.send_bytes(obj)
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 200, in send_bytes
    self._send_bytes(m[offset:offset + size])
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 427, in _send_bytes
    self._send(header + buf)
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 384, in _send
    n = write(self._handle, buf)
        ^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.12/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.12/multiprocessing/pool.py", line 136, in worker
    put((job, i, (False, wrapped)))
  File "/usr/lib/python3.12/multiprocessing/queues.py", line 399, in put
    self._writer.send_bytes(obj)
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 200, in send_bytes
    self._send_bytes(m[offset:offset + size])
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 427, in _send_bytes
    self._send(header + buf)
  File "/usr/lib/python3.12/multiprocessing/connection.py", line 384, in _send
    n = write(self._handle, buf)
        ^^^^^^^^^^^^^^^^^^^^^^^^
BrokenPipeError: [Errno 32] Broken pipe
@Dieterbe
Copy link
Author

Dieterbe commented Oct 5, 2024

now it also says

/usr/lib/python3.12/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 9 leaked semaphore objects to clean up at shutdown
  warnings.warn('resource_tracker: There appear to be %d '

@Dieterbe
Copy link
Author

Dieterbe commented Oct 5, 2024

when i run a bash loop and do every pdf separately, it works fine.

@Dieterbe
Copy link
Author

Dieterbe commented Oct 6, 2024

To be clear, I'm not asking for, or expecting support. Just wanted to post it in case anyone wants to work on it or if it's helpful to someone.

@VikParuchuri
Copy link
Owner

I suspect this is an out of memory error - I will fix it in the next update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants