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

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

Open
wwma opened this issue Nov 15, 2024 · 14 comments
Open

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

wwma opened this issue Nov 15, 2024 · 14 comments

Comments

@wwma
Copy link

wwma commented Nov 15, 2024

  • 版本、环境信息:
       1)Paddle Lite 版本:v2.14-rc
       2)Host 环境:在windows下使用wsl提供的Linux系统

  • 编译/安装方式信息:
    1)docker 编译:

#本地源码编译 Docker 镜像
git clone https://github.com/PaddlePaddle/Paddle-Lite.git
cd Paddle-Lite/lite/tools
mkdir mobile_image
cp Dockerfile.mobile mobile_image/Dockerfile
cd mobile_image
docker build -t paddlepaddle/paddle-lite .

报错信息:

 => 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
Copy link
Collaborator

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

docker pull paddlepaddle/paddle-lite:latest

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

@wwma
Copy link
Author

wwma commented Nov 15, 2024

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
Copy link
Collaborator

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

@wwma
Copy link
Author

wwma commented Nov 18, 2024

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

通过pip install paddlelite ,成功安装了2.13版本,但是在使用以下语句时,会提示错误:
Segmentation fault (core dumped)
以下是log信息
[3 11/18 10:55:33.986 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.989 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.990 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.991 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.994 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.994 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.995 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.998 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.999 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33. 9 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33. 10 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [1 11/18 10:55:34. 15 .../Paddle-Lite/lite/operators/concat_op.cc:53 InferShapeImpl] out_dims[j] == input_dims_i[j] check failed! [1 11/18 10:55:34. 15 .../Paddle-Lite/lite/operators/concat_op.cc:53 InferShapeImpl] 7 != 17
请问是哪里有问题?

@SongMingzhe
Copy link
Collaborator

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

通过pip install paddlelite ,成功安装了2.13版本,但是在使用以下语句时,会提示错误: Segmentation fault (core dumped) 以下是log信息 [3 11/18 10:55:33.986 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.989 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.990 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.991 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.994 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.994 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.995 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.998 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.999 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33. 9 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33. 10 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [1 11/18 10:55:34. 15 .../Paddle-Lite/lite/operators/concat_op.cc:53 InferShapeImpl] out_dims[j] == input_dims_i[j] check failed! [1 11/18 10:55:34. 15 .../Paddle-Lite/lite/operators/concat_op.cc:53 InferShapeImpl] 7 != 17 请问是哪里有问题?

这里你执行的命令是什么样的呢?

@wwma
Copy link
Author

wwma commented Nov 18, 2024

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

通过pip install paddlelite ,成功安装了2.13版本,但是在使用以下语句时,会提示错误: Segmentation fault (core dumped) 以下是log信息 [3 11/18 10:55:33.986 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.989 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.990 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.991 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.994 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.994 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.995 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.998 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.999 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33. 9 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33. 10 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [1 11/18 10:55:34. 15 .../Paddle-Lite/lite/operators/concat_op.cc:53 InferShapeImpl] out_dims[j] == input_dims_i[j] check failed! [1 11/18 10:55:34. 15 .../Paddle-Lite/lite/operators/concat_op.cc:53 InferShapeImpl] 7 != 17 请问是哪里有问题?

这里你执行的命令是什么样的呢?

执行的命令是这个:
python lite/demo/python/mobilenetv1_light_api.py --model_dir=pplite_opt.nb --image_path=pic.jpg

后面通过更改图片的大小,不会再有报错信息了。但是结果全是0,和未转换的模型结果不一致,请问应该怎么解决?
image

@yulangz
Copy link

yulangz commented Nov 18, 2024

image

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

通过pip install paddlelite ,成功安装了2.13版本,但是在使用以下语句时,会提示错误: Segmentation fault (core dumped) 以下是log信息 [3 11/18 10:55:33.986 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.989 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.990 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.991 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.994 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.994 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.995 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.998 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.999 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33. 9 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33. 10 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [1 11/18 10:55:34. 15 .../Paddle-Lite/lite/operators/concat_op.cc:53 InferShapeImpl] out_dims[j] == input_dims_i[j] check failed! [1 11/18 10:55:34. 15 .../Paddle-Lite/lite/operators/concat_op.cc:53 InferShapeImpl] 7 != 17 请问是哪里有问题?

这里你执行的命令是什么样的呢?

执行的命令是这个: python lite/demo/python/mobilenetv1_light_api.py --model_dir=pplite_opt.nb --image_path=pic.jpg

后面通过更改图片的大小,不会再有报错信息了。但是结果全是0,和未转换的模型结果不一致,请问应该怎么解决? image

请问模型是怎么转换的呢?我本地复现没有这个问题
image

@wwma
Copy link
Author

wwma commented Nov 19, 2024

image > > > > paddlepaddle/paddle-lite:latest 这个镜像是一个编译环境,我们用它来编译各种库文件和工具。 > > > > paddle_lite_opt 这是一个python命令行工具,用来把paddlepaddle训练出来的模型优化成端侧推理需要用的模型文件 安装使用方法 [https://www.paddlepaddle.org.cn/lite/v2.12/user_guides/opt/opt_python.html。](https://www.paddlepaddle.org.cn/lite/v2.12/user_guides/opt/opt_python.html%E3%80%82) 这个命令行工具不是必须在paddlepaddle/paddle-lite:latest镜像中使用,一般python环境都能用。 > > > > 此外,还有一个命令行工具可以用来把paddlepaddle训练出来的模型优化成端侧推理需要用的模型文件: https://github.com/PaddlePaddle/Paddle-Lite/releases/download/v2.12/opt_linux 这个不是python命令行。根据你的操作系统不同,可以下载Linux/macOS > > > > > > > > > 通过`pip install paddlelite` ,成功安装了2.13版本,但是在使用以下语句时,会提示错误: `Segmentation fault (core dumped)` 以下是log信息 `[3 11/18 10:55:33.986 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.989 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.990 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.991 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.994 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.994 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.995 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.998 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33.999 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33. 9 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [3 11/18 10:55:33. 10 ...le-Lite/lite/kernels/x86/conv_compute.cc:119 PrepareForRun] invoking directConv [1 11/18 10:55:34. 15 .../Paddle-Lite/lite/operators/concat_op.cc:53 InferShapeImpl] out_dims[j] == input_dims_i[j] check failed! [1 11/18 10:55:34. 15 .../Paddle-Lite/lite/operators/concat_op.cc:53 InferShapeImpl] 7 != 17 ` 请问是哪里有问题? > > > > > > 这里你执行的命令是什么样的呢? > > > 执行的命令是这个: `python lite/demo/python/mobilenetv1_light_api.py --model_dir=pplite_opt.nb --image_path=pic.jpg` > 后面通过更改图片的大小,不会再有报错信息了。但是结果全是0,和未转换的模型结果不一致,请问应该怎么解决? ![image](https://private-user-images.githubusercontent.com/52616002/387083237-73f8af3d-b3eb-4177-b430-ed579fce2278.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzE5Mjk0NTMsIm5iZiI6MTczMTkyOTE1MywicGF0aCI6Ii81MjYxNjAwMi8zODcwODMyMzctNzNmOGFmM2QtYjNlYi00MTc3LWI0MzAtZWQ1NzlmY2UyMjc4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTE4VDExMjU1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU4N2ZjN2U4NDM2YzA1ODg5NWI1Yzc3OTJkZDZlM2JiZmFiYjI2M2I1MzIwMWM2OWFlNjZiNTVhMzIxNjIzYWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.eO0945U3OuGBso9Wir-6L4KjaZ3jmaR23lArKF3rv44)

请问模型是怎么转换的呢?我本地复现没有这个问题 image

使用的是这个进行转换的
paddle_lite_opt --model_dir=model/ppliteseg --optimize_out=pplite_opt --optimize_out_type=naive_buffer --valid_targets=x86
这是原始模型链接:链接: https://pan.baidu.com/s/1VjmI9Vx6Mpvsn9vo_Tlbig?pwd=ietm 提取码: ietm 复制这段内容后打开百度网盘手机App,操作更方便哦
[这是转换后的模型:链接: https://pan.baidu.com/s/1jpVBQwO99xZ0pvH1iqln9g?pwd=x99c 提取码: x99c 复制这段内容后打开百度网盘手机App,操作更方便哦

@yulangz
Copy link

yulangz commented Nov 19, 2024

我看你的模型是 v2.13-rc 版本的 opt 工具导出的,可以尝试安装 v2.14-rc 版本的 opt 工具导出,我本地尝试不会出现全 0 的问题。
另外,lite/demo/python/mobilenetv1_light_api.py 这个 demo 是给 mobilenetv1 模型使用的,你提供的 ppliteseg 模型的输入输出 shape 以及 labels 数量与 mobilenetv1 demo 都不同,你可能需要修改脚本并且自行准备 labels 文件

@wwma
Copy link
Author

wwma commented Nov 19, 2024

在我配置的环境下,paddlelite版本是v2.13-rc,使用v2.14-rc的opt导出的模型下,结果仍为全0
image

@wwma
Copy link
Author

wwma commented Nov 19, 2024

在docker下运行会提示这个错误
image

@wwma
Copy link
Author

wwma commented Nov 21, 2024

我看你的模型是 v2.13-rc 版本的 opt 工具导出的,可以尝试安装 v2.14-rc 版本的 opt 工具导出,我本地尝试不会出现全 0 的问题。 另外,lite/demo/python/mobilenetv1_light_api.py 这个 demo 是给 mobilenetv1 模型使用的,你提供的 ppliteseg 模型的输入输出 shape 以及 labels 数量与 mobilenetv1 demo 都不同,你可能需要修改脚本并且自行准备 labels 文件

在我配置的环境下,paddlelite版本是v2.13-rc,使用v2.14-rc的opt导出的模型下,结果仍为全0

@yulangz
Copy link

yulangz commented Nov 22, 2024

@wwma
Copy link
Author

wwma commented Nov 22, 2024

图像分割模型可以尝试 https://paddle-model-ecology.bj.bcebos.com/paddlex/official_inference_model/paddle3.0/PP-LiteSeg-T_infer.tar,是支持的

有两个问题
一是配置文件应该怎么配置呢?以下会提示错误:
image

  File "tools\train.py", line 219, in <module>
    main(args)
  File "tools\train.py", line 183, in main
    model = utils.convert_sync_batchnorm(builder.model, args.device)
  File "e:\paddleseg\paddleseg\utils\utils.py", line 280, in __get__
    val = self.func(obj)
  File "e:\paddleseg\paddleseg\cvlibs\builder.py", line 154, in model
    return self.build_component(model_cfg)
  File "e:\paddleseg\paddleseg\cvlibs\builder.py", line 56, in build_component
    params[key] = self.build_component(val)
  File "e:\paddleseg\paddleseg\cvlibs\builder.py", line 72, in build_component
    raise RuntimeError(
RuntimeError: Tried to create a STDC1 object, but the operation has failed. Please double check the arguments used to create the object.      
The error message is:
The pretrained model directory is not Found: C:\Users\10910\.paddleseg\pretrained_model\PP-LiteSeg-T_infer\model.pdparams

二是为什么我把这个模型发给其他的人尝试就不会出现全0结果现象,但是自己测试就是全0

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

3 participants