[docs] update quick_start and README (#181)

* [docs] update quick_start and README

* [docs] remove ENABLE_PADDLE_FRONTEND flags in win docs

* [docs] update supported python version for win

* [docs] update windows sdk example docs

Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
DefTruth
2022-09-06 21:11:04 +08:00
committed by GitHub
parent d9a0dd328b
commit e1ab1104c2
4 changed files with 53 additions and 8 deletions

View File

@@ -69,7 +69,10 @@
```bash
pip install numpy opencv-python fastdeploy-gpu-python -f https://www.paddlepaddle.org.cn/whl/fastdeploy.html
```
##### [Anaconda配置GPU环境(推荐)](docs/quick_start/Python_prebuilt_wheels.md)
```bash
conda config --add channels conda-forge && conda install cudatoolkit=11.2 cudnn=8.2
```
##### 安装CPU版本
```bash

View File

@@ -17,7 +17,7 @@ git clone https://github.com/PaddlePaddle/FastDeploy.git
cd FastDeploy && git checkout develop
mkdir build && cd build
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=D:\Paddle\FastDeploy\build\fastdeploy-win-x64-0.2.0 -DENABLE_ORT_BACKEND=ON -DENABLE_VISION=ON -DENABLE_VISION_VISUALIZE=ON
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=D:\Paddle\FastDeploy\build\fastdeploy-win-x64-0.2.0 -DENABLE_ORT_BACKEND=ON -DENABLE_PADDLE_BACKEND=ON -DENABLE_VISION=ON -DENABLE_VISION_VISUALIZE=ON
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
```
@@ -32,7 +32,7 @@ git clone https://github.com/PaddlePaddle/FastDeploy.git
cd FastDeploy && git checkout develop
mkdir build && cd build
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=D:\Paddle\FastDeploy\build\fastdeploy-win-x64-gpu-0.2.0 -DWITH_GPU=ON -DENABLE_ORT_BACKEND=ON -DENABLE_VISION=ON -DENABLE_VISION_VISUALIZE=ON -DENABLE_PADDLE_FRONTEND=ON -DCUDA_DIRECTORY=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2
cmake .. -G "Visual Studio 16 2019" -A x64 -DCMAKE_INSTALL_PREFIX=D:\Paddle\FastDeploy\build\fastdeploy-win-x64-gpu-0.2.0 -DWITH_GPU=ON -DENABLE_ORT_BACKEND=ON -DENABLE_PADDLE_BACKEND=ON -DENABLE_VISION=ON -DENABLE_VISION_VISUALIZE=ON -DCUDA_DIRECTORY="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.2"
msbuild fastdeploy.sln /m /p:Configuration=Release /p:Platform=x64
msbuild INSTALL.vcxproj /m /p:Configuration=Release /p:Platform=x64
@@ -52,9 +52,11 @@ git clone https://github.com/PaddlePaddle/FastDeploy.git
cd FastDeploy && git checkout develop
set ENABLE_ORT_BACKEND=ON
set ENABLE_PADDLE_BACKEND=ON
set ENABLE_VISION=ON
set ENABLE_VISION_VISUALIZE=ON
% 这里指定用户自己的python解释器 以ptyhon3.8为例 %
% 这里指定用户自己的python解释器 以python3.8为例 %
C:\Python38\python.exe setup.py build
C:\Python38\python.exe setup.py bdist_wheel
```
@@ -75,14 +77,13 @@ set ENABLE_ORT_BACKEND=ON
% 说明如果不编译TensorRT后端 此项为OFF %
set ENABLE_TRT_BACKEND=ON
set ENABLE_PADDLE_BACKEND=ON
set ENABLE_PADDLE_FRONTEND=ON
set ENABLE_VISION=ON
set ENABLE_VISION_VISUALIZE=ON
git clone https://github.com/PaddlePaddle/FastDeploy.git
cd FastDeploy && git checkout develop
% 说明这里指定用户自己的python解释器 以ptyhon3.8为例 %
% 说明这里指定用户自己的python解释器 以python3.8为例 %
C:\Python38\python.exe setup.py build
C:\Python38\python.exe setup.py bdist_wheel
```

View File

@@ -40,6 +40,8 @@ cmake .. -G "Visual Studio 16 2019" -A x64 -DFASTDEPLOY_INSTALL_DIR=%cd%\..\..\.
```bat
msbuild infer_demo.sln /m:4 /p:Configuration=Release /p:Platform=x64
```
## 配置依赖库路径
#### 方式一:命令行设置环境变量
编译好的exe保存在Release目录下在运行demo前需要将模型和测试图片拷贝至该目录。另外需要在终端指定DLL的搜索路径。请在build目录下执行以下命令。
```bat
set FASTDEPLOY_PATH=%cd%\..\..\..\..\..\..\..\fastdeploy-win-x64-gpu-0.2.0
@@ -49,11 +51,26 @@ set PATH=%FASTDEPLOY_PATH%\lib;%FASTDEPLOY_PATH%\third_libs\install\onnxruntime\
```bat
copy /Y %FASTDEPLOY_PATH%\third_libs\install\onnxruntime\lib\onnxruntime* Release\
```
由于较新的Windows在System32系统目录下自带了onnxruntime.dll因此就算设置了PATH系统依然会出现onnxruntime的加载冲突。因此需要先拷贝demo用到的onnxruntime.dll到exe所在的目录。
由于较新的Windows在System32系统目录下自带了onnxruntime.dll因此就算设置了PATH系统依然会出现onnxruntime的加载冲突。因此需要先拷贝demo用到的onnxruntime.dll到exe所在的目录。如下
```bat
where onnxruntime.dll
C:\Windows\System32\onnxruntime.dll # windows自带的onnxruntime.dll
```
#### 方式二拷贝依赖库到exe的目录下
手动拷贝或者在build目录下执行以下命令
```bat
set FASTDEPLOY_PATH=%cd%\..\..\..\..\..\..\..\fastdeploy-win-x64-gpu-0.2.0
copy /Y %FASTDEPLOY_PATH%\lib\*.dll Release\
copy /Y %FASTDEPLOY_PATH%\third_libs\install\onnxruntime\lib\*.dll Release\
copy /Y %FASTDEPLOY_PATH%\third_libs\install\opencv-win-x64-3.4.16\build\x64\vc15\bin\*.dll Release\
copy /Y %FASTDEPLOY_PATH%\third_libs\install\paddle_inference\paddle\lib\*.dll Release\
copy /Y %FASTDEPLOY_PATH%\third_libs\install\paddle_inference\third_party\install\mkldnn\lib\*.dll Release\
copy /Y %FASTDEPLOY_PATH%\third_libs\install\paddle_inference\third_party\install\mklml\lib\*.dll Release\
copy /Y %FASTDEPLOY_PATH%\third_libs\install\paddle2onnx\lib\*.dll Release\
copy /Y %FASTDEPLOY_PATH%\third_libs\install\tensorrt\lib\*.dll Release\
copy /Y %FASTDEPLOY_PATH%\third_libs\install\yaml-cpp\lib\*.dll Release\
```
## 运行 demo
```bat
cd Release

View File

@@ -5,7 +5,7 @@ FastDeploy提供了在Windows/Linux/Mac上的预先编译Python Wheel包
目前各平台支持情况如下
- Linux 支持Python3.6~3.9
- Windows 支持Python3.8~3.9
- Windows 支持Python3.6~3.9
- Mac 支持Python3.6~3.9
## 安装 CPU Python 版本
@@ -17,6 +17,30 @@ pip install fastdeploy-python -f https://www.paddlepaddle.org.cn/whl/fastdeploy.
pip install fastdeploy-gpu-python -f https://www.paddlepaddle.org.cn/whl/fastdeploy.html
```
## Anaconda 快速配置 GPU 环境
使用Anaconda的用户可在命令运行以下命令快速配置GPU环境。如果是Windows用户需要先打开`Anaconda Prompt (anaconda3)`命令行终端。
- 增加 conda-forge 源
```bash
conda config --add channels conda-forge
# 国内用户可以增加国内的源,如
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
```
- 新建 python 环境
```bash
conda create -n py38 python=3.8
conda activate py38
```
- 安装 cudatoolkit 11.x 和 cudnn 8.x
```bash
conda install cudatoolkit=11.2 cudnn=8.2
```
- 安装 FastDeploy GPU 版本 Python 包
```bash
pip install fastdeploy-gpu-python -f https://www.paddlepaddle.org.cn/whl/fastdeploy.html
```
## 注意事项
- 不要重复安装`fastdeploy-python``fastdeploy-gpu-python`
- 如已安装CPU版本的`fastdeploy-python`在安装GPU版本的`fastdeploy-gpu-python`,请先执行`pip uninstall fastdeploy-python`卸载已有版本