Jetson AGX-Deploy Paddle Infence GPU prediction library based on python API

System environment

  • JetPack4.3

If you need this image, you can download it from Jetson Download Center .

Install PaddlePaddle

There are two ways, because nano officially has compiled whl of python3.6, so we just download it directly, without compiling.

Directly download the officially compiled Jetson all prediction library

download link
download

Select the download of python3.6 version.
Insert picture description here

2. Install dependencies

Install pip3 and upgrade:

sudo apt-get install python3-pip
pip3 install --upgrade pip

Change source, modify ~/.pip/pip.config:

mkdir ~/.pip
vim ~/.pip/pip.conf

Add content as follows:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = https://pypi.tuna.tsinghua.edu.cn

The 1.18.3 version of numpy must be installed here, otherwise an error will be reported later.

pip3 install numpy==1.18.3

3. Install whl

Transfer the downloaded whl file to the board, and then install whl:

pip3 install paddlepaddle_gpu-2.0.0-cp36-cp36m-linux_aarch64.whl

Screenshot of successful installation:
Insert picture description here

4. Test

Open python3:

import paddle
paddle.fluid.install_check.run_check()

Just report the warning and ignore it, and it will not affect the use.
Insert picture description here

Test Paddle Inference

Environmental preparation

拉取Paddle-Inference-Demo:

git clone https://github.com/PaddlePaddle/Paddle-Inference-Demo.git

Pull slower, then you can build a warehouse for download on gitee, I built a warehouse: https://gitee.com/irvingao/Paddle-Inference-Demo.git.

Test run through the GPU prediction model

Give executable permissions:

cd Paddle-Inference-Demo/python
chmod +x run_demo.sh

Then open it Run_demo.sh, delete x86the demo, and ELMOchange it toELMo
Insert picture description here

It should be noted that you need to modify the last in all subfolders to :run.shpythonpython3
Insert picture description here

./run_demo.sh

You can also choose to run a single model run.sh.
Insert picture description here
If all of them can run down without any problems, the deployment is successful. Just run your own model directly on AGX~

Error resolution

core dumped

The reason is because the numpy version that comes with JetPack4.3 is wrong, and the numpy version should be 1.18.3.

Insert picture description here
Solution:

pip3 uninstall numpy
python3 -m pip install numpy==1.18.3 -i https://mirror.baidu.com/pypi/simple

Guess you like

Origin blog.csdn.net/qq_45779334/article/details/115215340