PaddlePaddle / Paddle-Lite

PaddlePaddle High Performance Deep Learning Inference Engine for Mobile and Edge (飞桨高性能深度学习端侧推理引擎)
https://www.paddlepaddle.org.cn/lite
Apache License 2.0
6.97k stars 1.61k forks source link

Paddle-Lite在Docker 统一编译环境搭建失败 #10592

Open wwma opened 2 hours ago

wwma commented 2 hours ago

报错信息:

 => CACHED [14/18] RUN ln -s clang-format-3.8 /usr/bin/clang-format                                                0.0s
 => ERROR [15/18] RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple wheel                                4.4s
------
 > [15/18] RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple wheel:
0.501 Collecting wheel
0.822   Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e7/52/fd4516fb8f7d11a08e3f9cd69eb1558f098ab67e79f32d920c4974ee550f/wheel-0.45.0.tar.gz (107kB)
0.967 Building wheels for collected packages: wheel
0.968   Running setup.py bdist_wheel for wheel: started
1.023   Failed building wheel for wheel
1.023   Running setup.py bdist_wheel for wheel: finished with status 'error'
1.023   Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-OkcxG4/wheel/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpFg4GeZpip-wheel- --python-tag cp27:
1.023   /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
1.023     warnings.warn(msg)
1.023   usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
1.023      or: -c --help [cmd1 cmd2 ...]
1.023      or: -c --help-commands
1.023      or: -c cmd --help
1.023
1.023   error: invalid command 'bdist_wheel'
1.023
1.023   ----------------------------------------
1.023   Running setup.py clean for wheel
1.088 Failed to build wheel
1.088 Installing collected packages: wheel
1.089   Running setup.py install for wheel: started
1.150     Running setup.py install for wheel: finished with status 'error'
1.150     Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-OkcxG4/wheel/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-CsubNh-record/install-record.txt --single-version-externally-managed --compile:
1.150     /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
1.150       warnings.warn(msg)
1.150     running install
1.150     running build
1.150     running build_py
1.150     creating build
1.150     creating build/lib.linux-x86_64-2.7
1.150     creating build/lib.linux-x86_64-2.7/wheel
1.150     copying src/wheel/wheelfile.py -> build/lib.linux-x86_64-2.7/wheel
1.150     copying src/wheel/bdist_wheel.py -> build/lib.linux-x86_64-2.7/wheel
1.150     copying src/wheel/__init__.py -> build/lib.linux-x86_64-2.7/wheel
1.150     copying src/wheel/_bdist_wheel.py -> build/lib.linux-x86_64-2.7/wheel
1.150     copying src/wheel/metadata.py -> build/lib.linux-x86_64-2.7/wheel
1.150     copying src/wheel/_setuptools_logging.py -> build/lib.linux-x86_64-2.7/wheel
1.150     copying src/wheel/__main__.py -> build/lib.linux-x86_64-2.7/wheel
1.150     copying src/wheel/macosx_libfile.py -> build/lib.linux-x86_64-2.7/wheel
1.150     copying src/wheel/util.py -> build/lib.linux-x86_64-2.7/wheel
1.150     creating build/lib.linux-x86_64-2.7/wheel/cli
1.150     copying src/wheel/cli/__init__.py -> build/lib.linux-x86_64-2.7/wheel/cli
1.150     copying src/wheel/cli/convert.py -> build/lib.linux-x86_64-2.7/wheel/cli
1.150     copying src/wheel/cli/unpack.py -> build/lib.linux-x86_64-2.7/wheel/cli
1.150     copying src/wheel/cli/tags.py -> build/lib.linux-x86_64-2.7/wheel/cli
1.150     copying src/wheel/cli/pack.py -> build/lib.linux-x86_64-2.7/wheel/cli
1.150     creating build/lib.linux-x86_64-2.7/wheel/vendored
1.150     copying src/wheel/vendored/__init__.py -> build/lib.linux-x86_64-2.7/wheel/vendored
1.150     creating build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/_manylinux.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/utils.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/__init__.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/_musllinux.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/requirements.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/markers.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/_parser.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/_elffile.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/_structures.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/tags.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/_tokenizer.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/version.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     copying src/wheel/vendored/packaging/specifiers.py -> build/lib.linux-x86_64-2.7/wheel/vendored/packaging
1.150     error: can't copy 'src/wheel/vendored': doesn't exist or not a regular file
1.150
1.150     ----------------------------------------
1.153 Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-OkcxG4/wheel/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-CsubNh-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-OkcxG4/wheel/
4.380 You are using pip version 8.1.1, however version 24.3.1 is available.
4.380 You should consider upgrading via the 'pip install --upgrade pip' command.
------

 3 warnings found (use docker --debug to expand):
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 61)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 62)
 - MaintainerDeprecated: Maintainer instruction is deprecated in favor of using label (line 4)
Dockerfile:71
--------------------
  69 |     # clean
  70 |     RUN ln -s clang-format-3.8 /usr/bin/clang-format
  71 | >>> RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple wheel
  72 |     RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pre-commit
  73 |     RUN apt-get autoremove -y && apt-get clean
--------------------
ERROR: failed to solve: process "/bin/sh -c pip install -i https://pypi.tuna.tsinghua.edu.cn/simple wheel" did not complete successfully: exit code: 1
SongMingzhe commented 2 hours ago

paddle-lite有image可以用的,可以试试这个哦:

docker pull paddlepaddle/paddle-lite:latest

https://hub.docker.com/r/paddlepaddle/paddle-lite

wwma commented 56 minutes ago

paddle-lite有image可以用的,可以试试这个哦:

docker pull paddlepaddle/paddle-lite:latest

https://hub.docker.com/r/paddlepaddle/paddle-lite

谢谢,我已经成功安装好镜像了。 但是我按照以下代码启动docker

docker run -it \
  --name paddlelite_docker \
  -v $PWD/Paddle-Lite:/Paddle-Lite \
  --net=host \
  paddlepaddle/paddle-lite /bin/bash

无法进行预测

paddle_lite_opt --model_dir=./mobilenet_v1  \
                --optimize_out=mobilenet_v1_opt \
                --optimize_out_type=naive_buffer \
                --valid_targets=x86

会提示错误信息:

root@docker-desktop:/# paddle_lite_opt 
bash: paddle_lite_opt: command not found
SongMingzhe commented 10 minutes ago

paddlepaddle/paddle-lite:latest 这个镜像是一个编译环境,我们用它来编译各种库文件和工具。

paddle_lite_opt 这是一个python命令行工具,用来把paddlepaddle训练出来的模型优化成端侧推理需要用的模型文件 安装使用方法 https://www.paddlepaddle.org.cn/lite/v2.12/user_guides/opt/opt_python.html。 这个命令行工具不是必须在paddlepaddle/paddle-lite:latest镜像中使用,一般python环境都能用。

此外,还有一个命令行工具可以用来把paddlepaddle训练出来的模型优化成端侧推理需要用的模型文件: https://github.com/PaddlePaddle/Paddle-Lite/releases/download/v2.12/opt_linux 这个不是python命令行。根据你的操作系统不同,可以下载Linux/macOS