Closed Athe-kunal closed 1 month ago
Run pip install -U marker-pdf
. Should fix it
I encountered the same problem, but I have already taken action: pip install -U marker-pdf
。
run: marker_single /Users/tangxqa/Downloads/Demystifying_the_Topologies_Behind_prompting_1706394504.pdf ./output --batch_multiplier 1 --max_pages 10 --langs Chinese
/opt/anaconda3/lib/python3.11/site-packages/threadpoolctl.py:1214: RuntimeWarning:
Found Intel OpenMP ('libiomp') and LLVM OpenMP ('libomp') loaded at
the same time. Both libraries are known to be incompatible and this
can cause random crashes or deadlocks on Linux when loaded in the
same Python program.
Using threadpoolctl may cause crashes or deadlocks. For more
information and possible workarounds, please see
https://github.com/joblib/threadpoolctl/blob/master/multiple_openmp.md
warnings.warn(msg, RuntimeWarning)
Loading detection model vikp/surya_det2 on device cpu with dtype torch.float32
Loading detection model vikp/surya_layout2 on device cpu with dtype torch.float32
Loading reading order model vikp/surya_order on device mps with dtype torch.float16
Loaded texify model to mps with torch.float16 dtype
Traceback (most recent call last):
File "/opt/anaconda3/bin/marker_single", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/anaconda3/lib/python3.11/site-packages/convert_single.py", line 26, in main
full_text, images, out_meta = convert_single_pdf(fname, model_lst, max_pages=args.max_pages, langs=langs, batch_multiplier=args.batch_multiplier)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/lib/python3.11/site-packages/marker/convert.py", line 65, in convert_single_pdf
pages, toc = get_text_blocks(
^^^^^^^^^^^^^^^^
File "/opt/anaconda3/lib/python3.11/site-packages/marker/pdf/extract_text.py", line 85, in get_text_blocks
char_blocks = dictionary_output(doc, page_range=page_range, keep_chars=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/lib/python3.11/site-packages/pdftext/extraction.py", line 65, in dictionary_output
pages = _get_pages(pdf_path, model, page_range, workers=workers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/lib/python3.11/site-packages/pdftext/extraction.py", line 26, in _get_pages
pdf_doc = pdfium.PdfDocument(pdf_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/lib/python3.11/site-packages/pypdfium2/_helpers/document.py", line 78, in __init__
self.raw, to_hold, to_close = _open_pdf(self._input, self._password, self._autoclose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/lib/python3.11/site-packages/pypdfium2/_helpers/document.py", line 674, in _open_pdf
raise TypeError(f"Invalid input type '{type(input_data).__name__}'")
TypeError: Invalid input type 'PdfDocument'
The code you're showing in the traceback is not from the latest version. Check if you have 0.2.9
marker-pdf (0.2.9) but i have the same issue on linux.
marker-pdf(0.2.8) is ok on windows.
marker-pdf (0.2.9) but i have the same issue on linux.
marker-pdf(0.2.8) is ok on windows.
marker-pdf (0.2.9-0.2.13) have the same issue on ubuntu22.04(wsl2)
I took the
convert_single.py
file and ran the following code on Google colab after doingpip install marker-pdf
I am getting the following error
The full error trace is here
Also, I tried with the command line, and I got this error. How can I resolve it?