VikParuchuri / marker

Convert PDF to markdown quickly with high accuracy
https://www.datalab.to
GNU General Public License v3.0
17.84k stars 1.03k forks source link

ImportError: cannot import name 'segformer' from 'surya.model.detection' (unknown location) #247

Open Beaverfffan opened 3 months ago

Beaverfffan commented 3 months ago

marker /mnt/f/markerpdfsource /mnt/f/output/folder --workers 1 --max 1000 --langs Chinese Traceback (most recent call last): File "/home/shenteng/anaconda3/bin/marker", line 5, in from convert import main File "/home/shenteng/anaconda3/lib/python3.12/site-packages/convert.py", line 9, in from marker.convert import convert_single_pdf File "/home/shenteng/anaconda3/lib/python3.12/site-packages/marker/convert.py", line 14, in from marker.ocr.recognition import run_ocr File "/home/shenteng/anaconda3/lib/python3.12/site-packages/marker/ocr/recognition.py", line 10, in from marker.models import setup_recognition_model File "/home/shenteng/anaconda3/lib/python3.12/site-packages/marker/models.py", line 2, in from surya.model.detection import segformer ImportError: cannot import name 'segformer' from 'surya.model.detection' (unknown location)

Blackskyliner commented 3 months ago

You need to pin the ocr lib to surya-ocr = "0.4.14" until code is adjusted for new interfaces.