adithya-s-k / marker-api

Easily deployable 🚀 API to convert PDF to markdown quickly with high accuracy.
GNU General Public License v3.0
692 stars 63 forks source link

ImportError: cannot import name 'segformer' from 'surya.model.detection' #12

Closed u2003 closed 2 weeks ago

u2003 commented 1 month ago

Hello, I followed the instructions from your readme file, yet ended up in running into error. And the detailed error info attached hereof:

yutang@bogon marker-api % marker_api /Users/yutang/Library/Python/3.9/lib/python/site-packages/urllib3/init.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020 warnings.warn( Traceback (most recent call last): File "/Users/yutang/Library/Python/3.9/bin/marker_api", line 5, in from server import main File "/Users/yutang/marker-api/server.py", line 10, in from marker.parse import parse_single_pdf # Import function to parse PDF File "/Users/yutang/marker-api/marker/parse.py", line 14, in from marker.ocr.recognition import run_ocr File "/Users/yutang/marker-api/marker/ocr/recognition.py", line 11, in from marker.models import setup_recognition_model File "/Users/yutang/marker-api/marker/models.py", line 2, in from surya.model.detection import segformer ImportError: cannot import name 'segformer' from 'surya.model.detection' (unknown location)

magdalenavonschwerin commented 1 month ago

I have the same issue after following all the installation steps.

JJianggg commented 1 month ago

I have the issue too

CoCu888 commented 1 month ago

me too

CoCu888 commented 1 month ago

surya的github连接把segformer删了,不知道是不是这个原因影响的

u2003 commented 1 month ago

Yep, I also noticed the absence of segformer. do you know how to solve this issue?

u2003 commented 1 month ago

@adithya-s-k Is there anything wrong in the code you provided, or is it still functional until now? How can we resolve this problem? Your help would be highly appreciated!

JJianggg commented 1 month ago

I use marker_api this instruction works fine python server.py will report the above error

u2003 commented 1 month ago

I use marker_api this instruction works fine python server.py will report the above error

Do you mean you actually set up marker-api correctly following this code and suceed in pdf to markdown transformation with it? I'm wondering how it works, could you please provide us with more detailed information? thanks a lot

PangDingPing commented 1 month ago

The marker_api and running python server.py both do not work.

CoCu888 commented 1 month ago

@adithya-s-k Is there anything wrong in the code you provided, or is it still functional until now? How can we resolve this problem? Your help would be highly appreciated!

我查看我的包版本,一个包卸载之重新下载了,最后运行成功了

u2003 commented 4 weeks ago

@adithya-s-k Is there anything wrong in the code you provided, or is it still functional until now? How can we resolve this problem? Your help would be highly appreciated!

我查看我的包版本,一个包卸载之重新下载了,最后运行成功了

请问如何操作呢,可以请您详细说一下操作步骤吗,非常感谢!

CoCu888 commented 3 weeks ago

就是看requirement里面的依赖版本和本地的版本是否有差异,有差异,就使用命令下载指定版本的依赖即可

u2003 commented 3 weeks ago

就是看requirement里面的依赖版本和本地的版本是否有差异,有差异,就使用命令下载指定版本的依赖即可

@CoCu888 您可以具体说一下按照现在的readme操作之后需要重新安装哪些依赖呢,我不是非常熟悉编程所以可能不太能立马反应过来,非常感谢!

u2003 commented 2 weeks ago

it seems that this issue has been solved after I gave it another try