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

paddleX推理产线缺少inference.yml #2736

Open
cmx4869 opened this issue Dec 27, 2024 · 4 comments
Open

paddleX推理产线缺少inference.yml #2736

cmx4869 opened this issue Dec 27, 2024 · 4 comments
Assignees

Comments

@cmx4869
Copy link

cmx4869 commented Dec 27, 2024

Checklist:

描述问题

我的服务器无法联公网,我尝试使用paddleX的docker+指定生产线文件+外挂模型,但是报错:
FileNotFoundError: [Errno 2] No such file or directory: '/root/PaddleX/paddlex/paddle_model_yaml/PP-OCRv4_mobile_rec/inference.yml'

我尝试了如下:
1.在能连接公网的服务器上,进入PaddleX的docker执行paddlex --pipeline OCR --input paddle/docker/1.png --device gpu:0 --save_path /paddle,看到了下载完成rec\det模型的信息,然后将docker保存打包,迁移到无网服务器上,仍然提示无法连接网络下载模型

2.更改产线配置文件,产生了FileNotFoundError]): [Errno 2] No such file or directory: '/root/PaddleX/paddlex/paddle_model_yaml/PP-OCRv4_mobile_rec/inference.yml'
已经尝试了尝试了#2619中的下载方式,其中v4的server和mobile仍然没有yml文件

使用的产线配置yml如下:
Global:
pipeline_name: OCR
input: paddle/docker/1.png

Pipeline:
text_det_model: /root/PaddleX/paddlex/paddle_model_yaml/PP-OCRv4_mobile_det_infer
text_rec_model: /root/PaddleX/paddlex/paddle_model_yaml/PP-OCRv4_server_rec
text_rec_batch_size: 1
device: "gpu:0"

我确认对应路径能被访问,文件来自官网。
请求您的帮助,我更倾向于能使用外挂模型+自定义产线配置yaml来执行

复现

产线配置yaml:
Global:
pipeline_name: OCR
input: paddle/docker/1.png

Pipeline:
text_det_model: /root/PaddleX/paddlex/paddle_model_yaml/PP-OCRv4_mobile_det_infer
text_rec_model: /root/PaddleX/paddlex/paddle_model_yaml/PP-OCRv4_server_rec
text_rec_batch_size: 1
device: "gpu:0"

执行指令:
paddlex --pipeline /root/PaddleX/paddlex/paddle_model_yaml/OCR.yaml --input paddle/docker/1.png --device gpu:0 --save_path /paddle

1.服务化部署
*未能跑通服务化部署流程

* 未使用高性能,未激活

2.您使用的模型数据集是?
PP-OCRv4_server_det_infer和PP-OCRv4_server_rec_infer,均使用#2619中提到的官网地址下载

  1. 请提供您出现的报错信息及相关log
    如问题描述所写

环境

  1. 请提供您使用的PaddlePaddle、PaddleX版本号、Python版本号
    PaddleX docker 使用如下命令下载
    docker run --gpus all --name paddlex -v $PWD:/paddle --shm-size=8G --network=host -it ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:3.0.0b2-gpu-cuda12.3-cudnn9.0-trt8.6 /bin/bash
  2. 请提供您使用的操作系统信息,如Linux/Windows/MacOS
    Ubuntu22.04
  3. 请问您使用的CUDA/cuDNN的版本号是?
    12.3
@cmx4869
Copy link
Author

cmx4869 commented Dec 27, 2024

##并且我确认我的方法1里面转移过来的docker中的officia目录已经包含模型:
root123 ~/.paddlex/official_models ls
Mask-RT-DETR-S/ PP-LCNet_x1_0_ML/ PP-OCRv4_mobile_det/ PicoDet-S/ RT-DETR-H_layout_17cls/
PP-LCNet_x0_5/ PP-LiteSeg-T/ PP-YOLOE_plus_SOD-L/ PicoDet_layout_1x_table/ RT-DETR-H_layout_3cls/

##但是执行官方的产线启动命令仍然报错:
λ root123 ~/.paddlex/official_models paddlex --pipeline OCR --input general_ocr_002.png --device gpu:0
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
/usr/local/lib/python3.10/dist-packages/setuptools-68.2.2-py3.10.egg/_distutils_hack/init.py:18: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the distutils module in sys.modules. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
warnings.warn(
/usr/local/lib/python3.10/dist-packages/setuptools-68.2.2-py3.10.egg/_distutils_hack/init.py:33: UserWarning: Setuptools is replacing distutils.
warnings.warn("Setuptools is replacing distutils.")
Using official model (PP-OCRv4_mobile_rec), the model files will be be automatically downloaded and saved in /root/.paddlex/official_models.
Connecting to https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b2/PP-OCRv4_mobile_rec_infer.tar ...
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn
conn = connection.create_connection(
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 61, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/lib/python3.10/socket.py", line 967, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 666, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 377, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1001, in _validate_conn
conn.connect()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 314, in connect
conn = self._new_conn()
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 171, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f1d64bd08b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 720, in urlopen
retries = retries.increment(
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 438, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='paddle-model-ecology.bj.bcebos.com', port=443): Max retries exceeded with url: /paddlex/official_inference_model/paddle3.0b2/PP-OCRv4_mobile_rec_infer.tar (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1d64bd08b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/paddlex", line 8, in
sys.exit(console_entry())
File "/root/PaddleX/paddlex/main.py", line 26, in console_entry
code = main()
File "/root/PaddleX/paddlex/paddlex_cli.py", line 189, in main
return pipeline_predict(
File "/root/PaddleX/paddlex/paddlex_cli.py", line 142, in pipeline_predict
pipeline = create_pipeline(
File "/root/PaddleX/paddlex/inference/pipelines/init.py", line 119, in create_pipeline
return create_pipeline_from_config(
File "/root/PaddleX/paddlex/inference/pipelines/init.py", line 94, in create_pipeline_from_config
pipeline = BasePipeline.get(pipeline_name)(
File "/root/PaddleX/paddlex/inference/pipelines/base.py", line 39, in patched___init_
ret = ctx.run(init_func, self, *args, **kwargs)
File "/root/PaddleX/paddlex/inference/pipelines/ocr.py", line 36, in init
self._build_predictor(text_det_model, text_rec_model)
File "/root/PaddleX/paddlex/inference/pipelines/ocr.py", line 44, in _build_predictor
self.text_rec_model = self._create(model=text_rec_model)
File "/root/PaddleX/paddlex/inference/pipelines/base.py", line 71, in _create
return create_predictor(
File "/root/PaddleX/paddlex/inference/models/init.py", line 74, in create_predictor
model_dir = check_model(model)
File "/root/PaddleX/paddlex/inference/models/init.py", line 102, in check_model
return official_models[model]
File "/root/PaddleX/paddlex/inference/utils/official_models.py", line 282, in getitem
download_and_extract(url, save_dir, f"{key}", overwrite=False)
File "/root/PaddleX/paddlex/utils/download.py", line 163, in download_and_extract
_download(url, arc_file_path, print_progress=print_progress)
File "/root/PaddleX/paddlex/utils/download.py", line 51, in _download
with requests.get(url, stream=True, timeout=15) as r:
File "/usr/local/lib/python3.10/dist-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.10/dist-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/requests/adapters.py", line 700, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='paddle-model-ecology.bj.bcebos.com', port=443): Max retries exceeded with url: /paddlex/official_inference_model/paddle3.0b2/PP-OCRv4_mobile_rec_infer.tar (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f1d64bd08b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution'))

@cuicheng01
Copy link
Collaborator

cuicheng01 commented Dec 29, 2024

没太明白的你的意思,看你补充的信息,更像是网络的问题,在您补充的信息里,我注意到了URL的链接是https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0b2/PP-OCRv4_mobile_rec_infer.tar
但是这个URL下载后是有inference.yml的,所以不知道你的困惑点是什么呢?

@cmx4869
Copy link
Author

cmx4869 commented Dec 30, 2024

我发现了,我的远程win下载下来没有yml,本地下载有yml,太神奇了。先谢谢您!

@cuicheng01
Copy link
Collaborator

远程的win是怎么下载的呢?这个按理来说不应该

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