Skip to content

模型下载问题 #627

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

Closed
4 tasks done
xxtyydsjdz opened this issue Feb 14, 2025 · 11 comments
Closed
4 tasks done

模型下载问题 #627

xxtyydsjdz opened this issue Feb 14, 2025 · 11 comments
Labels
bug Something isn't working

Comments

@xxtyydsjdz
Copy link

在提问之前...

  • 我已经搜索了现有的 issues
  • 我在提问题之前至少花费了 5 分钟来思考和准备
  • 我已经认真且完整的阅读了 wiki
  • 我已经认真检查了问题和网络环境无关

使用的环境

OS: Ubuntu 24.10
Python: 3.10.0
pdf2zh: 1.9.0

描述你的问题

项目启动就报错,网络肯定没有问题
Traceback (most recent call last):
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/connection.py", line 198, in _new_conn
sock = connection.create_connection(
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection
raise err
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/util/connection.py", line 73, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
response = self._make_request(
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 488, in _make_request
raise new_e
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 464, in _make_request
self._validate_conn(conn)
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1093, in _validate_conn
conn.connect()
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/connection.py", line 704, in connect
self.sock = sock = self._new_conn()
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/connection.py", line 213, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7106c7d70a00>: Failed to establish a new connection: [Errno 101] Network is unreachable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/connectionpool.py", line 841, in urlopen
retries = retries.increment(
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/urllib3/util/retry.py", line 519, in increment
raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type]
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /wybxc/DocLayout-YOLO-DocStructBench-onnx/resolve/main/doclayout_yolo_docstructbench_imgsz1024.onnx (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7106c7d70a00>: Failed to establish a new connection: [Errno 101] Network is unreachable'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1374, in _get_metadata_or_catch_error
metadata = get_hf_file_metadata(
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1294, in get_hf_file_metadata
r = _request_wrapper(
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 278, in _request_wrapper
response = _request_wrapper(
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 301, in _request_wrapper
response = get_session().request(method=method, url=url, **params)
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/huggingface_hub/utils/_http.py", line 93, in send
return super().send(request, *args, **kwargs)
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/requests/adapters.py", line 700, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: (MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /wybxc/DocLayout-YOLO-DocStructBench-onnx/resolve/main/doclayout_yolo_docstructbench_imgsz1024.onnx (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7106c7d70a00>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"), '(Request ID: 0a28ba3f-3ed4-4ba2-a4c1-ea9b8d7d3b1a)')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/jdz/Documents/CodeData/end-design/IntelligentTeachingAssistantSystem/translate-api/main.py", line 15, in
from api.main import api_router
File "/home/jdz/Documents/CodeData/end-design/IntelligentTeachingAssistantSystem/translate-api/api/main.py", line 10, in
from api.routes.translate_controller import translateController
File "/home/jdz/Documents/CodeData/end-design/IntelligentTeachingAssistantSystem/translate-api/api/routes/translate_controller.py", line 6, in
from service.translate_service import TranslateService
File "/home/jdz/Documents/CodeData/end-design/IntelligentTeachingAssistantSystem/translate-api/service/translate_service.py", line 6, in
from celery_task.translate_task import translate_pdf_task
File "/home/jdz/Documents/CodeData/end-design/IntelligentTeachingAssistantSystem/translate-api/celery_task/translate_task.py", line 7, in
model = OnnxModel.load_available()
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/pdf2zh/doclayout.py", line 25, in load_available
return DocLayoutModel.load_onnx()
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/pdf2zh/doclayout.py", line 17, in load_onnx
model = OnnxModel.from_pretrained(
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/pdf2zh/doclayout.py", line 87, in from_pretrained
pth = hf_hub_download(repo_id=repo_id, filename=filename, etag_timeout=1)
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/huggingface_hub/utils/_validators.py", line 114, in _inner_fn
return fn(*args, **kwargs)
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 860, in hf_hub_download
return _hf_hub_download_to_cache_dir(
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 967, in _hf_hub_download_to_cache_dir
_raise_on_head_call_error(head_call_error, force_download, local_files_only)
File "/home/jdz/Documents/CodeData/CodeConfig/PythonConfig/ananconda3/envs/pdf2zh-env-10/lib/python3.10/site-packages/huggingface_hub/file_download.py", line 1485, in _raise_on_head_call_error
raise LocalEntryNotFoundError(
huggingface_hub.errors.LocalEntryNotFoundError: An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on.

如何复现

启动项目

预期行为

No response

相关 Logs


原始PDF文件

No response

还有别的吗?

No response

@xxtyydsjdz xxtyydsjdz added the bug Something isn't working label Feb 14, 2025
@hellofinch
Copy link
Contributor

@awwaawwa 网络问题 关闭issue。

@Wybxc
Copy link
Collaborator

Wybxc commented Feb 17, 2025

网络问题与本项目无关,请自行搜索解决方法

@Wybxc Wybxc closed this as not planned Won't fix, can't repro, duplicate, stale Feb 17, 2025
@xxtyydsjdz
Copy link
Author

网络问题与本项目无关,请自行搜索解决方法

确认不是网络问题啊,在windows能下载下来,在linux下不下来

@hellofinch
Copy link
Contributor

hellofinch commented Feb 17, 2025

Please check your connection and try again or make sure your Internet connection is on.

唉。。。。
你Windows上可能双击了代理软件在用了,linux下配置了吗?

@xxtyydsjdz
Copy link
Author

xxtyydsjdz commented Feb 17, 2025

Please check your connection and try again or make sure your Internet connection is on.

唉。。。。 你Windows上可能双击了代理软件在用了,linux下配置了吗?

是的,我这都检查了

Image

@hellofinch
Copy link
Contributor

你先试试你curl www.google.com 在linux下执行以后有输出不。

@xxtyydsjdz
Copy link
Author

你先试试你curl www.google.com 在linux下执行以后有输出不。

Image

Image可以的

@hellofinch
Copy link
Contributor

curl huggingface.co 看看控制台能输出东西不,还是卡住了。
要是卡住了就是网络问题,找置顶的issue。要是没卡住那就稀罕了。

@xxtyydsjdz
Copy link
Author

curl huggingface.co 看看控制台能输出东西不,还是卡住了。 要是卡住了就是网络问题,找置顶的issue。要是没卡住那就稀罕了。

Image真没卡住

我现在是自己把模型下载下来,然后该路径用

@hellofinch
Copy link
Contributor

改路径可是个麻烦事,我给你个路径结构,你试着弄弄吧。

Image

@xxtyydsjdz
Copy link
Author

改路径可是个麻烦事,我给你个路径结构,你试着弄弄吧。

Image

好的,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants