PaddlePaddle / Paddle

PArallel Distributed Deep LEarning: Machine Learning Framework from Industrial Practice (『飞桨』核心框架,深度学习&机器学习高性能单机、分布式训练和跨平台部署)
http://www.paddlepaddle.org/
Apache License 2.0
22.28k stars 5.61k forks source link

YOLOv8 export error: `ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory` #56876

Closed glenn-jocher closed 2 months ago

glenn-jocher commented 1 year ago

YOLOv8 paddle export is failing with the latest version of 1.4.1 of x2paddle in Google Colab with:

Reproduce

# Install
# pip install ultralytics paddlepaddle x2paddle

# Export
yolo export model=yolov8n.pt format=paddle

Result:

Downloading https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt to 'yolov8n.pt'...
100% 6.23M/6.23M [00:00<00:00, 243MB/s]
Ultralytics YOLOv8.0.167 🚀 Python-3.10.12 torch-2.0.1+cu118 CPU (Intel Xeon 2.20GHz)
YOLOv8n summary (fused): 168 layers, 3151904 parameters, 0 gradients

PyTorch: starting from 'yolov8n.pt' with input shape (1, 3, 640, 640) BCHW and output shape(s) (1, 84, 8400) (6.2 MB)
Error: Can not import paddle core while this file exists: /usr/local/lib/python3.10/dist-packages/paddle/fluid/libpaddle.so
PaddlePaddle: export failure ❌ 0.1s: libssl.so.1.1: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/usr/local/bin/yolo", line 8, in <module>
    sys.exit(entrypoint())
  File "/usr/local/lib/python3.10/dist-packages/ultralytics/cfg/__init__.py", line 446, in entrypoint
    getattr(model, mode)(**overrides)  # default args from model
  File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/model.py", line 313, in export
    return Exporter(overrides=args, _callbacks=self.callbacks)(model=self.model)
  File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/exporter.py", line 265, in __call__
    f[10], _ = self.export_paddle()
  File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/exporter.py", line 119, in outer_func
    raise e
  File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/exporter.py", line 114, in outer_func
    f, model = inner_func(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/ultralytics/engine/exporter.py", line 397, in export_paddle
    import x2paddle  # noqa
  File "/usr/local/lib/python3.10/dist-packages/x2paddle/__init__.py", line 3, in <module>
    from .core.program import PaddleGraph
  File "/usr/local/lib/python3.10/dist-packages/x2paddle/core/program.py", line 18, in <module>
    import paddle
  File "/usr/local/lib/python3.10/dist-packages/paddle/__init__.py", line 31, in <module>
    from .framework import monkey_patch_variable
  File "/usr/local/lib/python3.10/dist-packages/paddle/framework/__init__.py", line 17, in <module>
    from . import random  # noqa: F401
  File "/usr/local/lib/python3.10/dist-packages/paddle/framework/random.py", line 17, in <module>
    from paddle import fluid
  File "/usr/local/lib/python3.10/dist-packages/paddle/fluid/__init__.py", line 36, in <module>
    from . import framework
  File "/usr/local/lib/python3.10/dist-packages/paddle/fluid/framework.py", line 35, in <module>
    from . import core
  File "/usr/local/lib/python3.10/dist-packages/paddle/fluid/core.py", line 356, in <module>
    raise e
  File "/usr/local/lib/python3.10/dist-packages/paddle/fluid/core.py", line 269, in <module>
    from . import libpaddle
ImportError: libssl.so.1.1: cannot open shared object file: No such file or directory

You can run this code in Google Colab here:

https://colab.research.google.com/github/ultralytics/ultralytics/blob/main/examples/tutorial.ipynb

Screenshot 2023-08-31 at 16 56 27
glenn-jocher commented 1 year ago

Even just importing x2paddle causes this error, so it appears to be unrelated to ultralytics

Screenshot 2023-08-31 at 16 59 33
jiangjiajun commented 1 year ago

It seems the problem happend while import paddle framework. I will transfer this issue to github.com/PaddlePaddle/Paddle

BMukhtar commented 1 year ago

looks like the same issue as here: https://github.com/PaddlePaddle/Paddle/issues/55597

paddle-bot[bot] commented 2 months ago

Since you haven\'t replied for more than a year, we have closed this issue/pr. If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up. 由于您超过一年未回复,我们将关闭这个issue/pr。 若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。