惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
H
Heimdal Security Blog
K
Kaspersky official blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
S
Schneier on Security
G
GRAHAM CLULEY
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
C
CERT Recently Published Vulnerability Notes
Google DeepMind News
Google DeepMind News
罗磊的独立博客
Stack Overflow Blog
Stack Overflow Blog
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
C
Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Exploit Database - CXSecurity.com
Project Zero
Project Zero
Security Archives - TechRepublic
Security Archives - TechRepublic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 司徒正美
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
V
Visual Studio Blog
博客园 - Franky
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Jina AI
Jina AI
P
Proofpoint News Feed
P
Proofpoint News Feed
有赞技术团队
有赞技术团队
L
LINUX DO - 最新话题
宝玉的分享
宝玉的分享
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园 - 聂微东
T
The Blog of Author Tim Ferriss
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog
IT之家
IT之家
S
Security Affairs
博客园 - 叶小钗
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
N
News | PayPal Newsroom
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
W
WeLiveSecurity
The Last Watchdog
The Last Watchdog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
NISL@THU
NISL@THU

博客园 - 寒山潜龙

『性能』List 和 HashSet 查找性能比较 (任何数据量的检索 从此只用 HashSet ) 人脸识别算法总结 神解释:UART、I2C、SPI、1-wire四大通信接口 解决github不显示图片的问题 树莓派SD卡容量扩展的方法 树莓派安装opencv调用cv2时提示 ModuleNotFoundError: NO module named 'cv2’的解决方法 在数莓派32位系统中安装opencv 4.5.5 树莓派官方32位和64位系统换源 linux系统压缩备份 Linux 解决 hosts 文件无法修改: ‘readonly‘ option is set (add ! to override) Paddle Lite——报错解决:基于Paddle Lite Demo运行run.sh编译报错无法运行 Debian系统安装opencv github 打不开一招搞定! - 寒山潜龙 C#之虚函数 非常清晰全面的讲解 今天有个朋友问我抽象方法和接口的区别,为了解释清楚这个事情,我在网上看到一篇文章讲的非常好给大家分享一下,也感谢原作者的付出 SQL2005四个排名函数(row_number、rank、dense_rank和ntile)的比较 Redis 集群方案 Android SDK Manager国内更新代理 AndroidDevTools简介 The status code returned from the server was: 500
树莓派4B安装 百度飞桨paddlelite 做视频检测 (一、环境安装)
寒山潜龙 · 2022-03-08 · via 博客园 - 寒山潜龙

前言:

当前准备重新在树莓派4B8G 上面搭载训练模型进行识别检测,训练采用了百度飞桨的PaddleX再也不用为训练部署环境各种报错发愁了,推荐大家使用。

关于在树莓派4B上面paddlelite的文章很多,特别是 诺亚方包 还有 耐心的小黑    的教程给了我很多指导,再此对他们表示感谢。

这次将采用最新的包进行部署,希望能将全过程记录下来跟大家做个分享

linux系统采用了官方最新的Raspberry Pi 64位系统   :Raspberry Pi OS with desktop

https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2022-01-28/2022-01-28-raspios-bullseye-arm64.zip 

  • Raspberry Pi OS with desktop

    • Release date: January 28th 2022
    • System: 64-bit
    • Kernel version: 5.10
    • Debian version: 11 (bullseye)
    • Size: 1,135MB

一、完成Linux 本地编译环境的准备
安装patchelf
sudo apt install patchelf

sudo apt-get install libssl-dev

更新一下目录
sudo apt-get update

升级安装
sudo apt-get install -y


安装gcc g++
sudo apt-get install gcc g++


安装cmake
wget https://github.com/Kitware/CMake/releases/download/v3.23.0-rc2/cmake-3.23.0-rc2.tar.gz
tar -zxvf cmake-3.23.0-rc2.tar.gz

配置
cd cmake-3.23.0-rc2
./configure

开始编译:
make          

(漫长的等待...)

安装:

sudo make install

查看cmake版本以验证安装成功:

cmake --version

二、源码编译

1. 下载Paddle-Lite 源码(当前最新版本为V2.10)  注意:如果你的Terminal当前目录还在 cmake目录下请退到根目录再进行下面的命令,最简单的办法就是关掉再重新打开一下,这样可以避免下载完找不到目录的错误!

 注意:如果不在GitHub下载,在git checkout release/v2.10 切换分支的时候要注意下载下来的文件名称大小写

git clone https://github.com/PaddlePaddle/Paddle-Lite.git

切换到发布分支

cd Paddle-Lite && git checkout release/v2.10

(可选) 删除 third-party 目录,编译脚本会自动从国内 CDN 下载第三方库文件

 rm -rf third-party

执行编译脚本

./lite/tools/build_linux.sh --arch=armv7hf   --with_python=ON 


 ./lite/tools/build_linux.sh --arch=armv8  --with_python=ON

(参考:https://paddle-lite.readthedocs.io/zh/release-v2.10_a/source_compile/arm_linux_compile_arm_linux.html)

注意:

如果你使用官方教程执行编译脚本

./lite/tools/build_linux.sh

估计你跟我最初一样会报错,耗费了很长时间才搞定,后面必须加参数:

Make Error at CMakeLists.txt:34 (project):
The CMAKE_CXX_COMPILER:

aarch64-linux-gnu-g++

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:34 (project):
The CMAKE_C_COMPILER:

aarch64-linux-gnu-gcc

is not a full path and was not found in the PATH.

Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.

ok,经过上面的经验你已经成功避过了一个坑,但是如果你的网络环境不是国内外通杀的话,执行过程中会报以下错误

RPC failed; curl 56 GnuTLS recv error (-54): Error in the pull function.

经过我不断出坑如坑的血泪经验,再传授一招,来拯救你那脆弱的git速度:

修改下载方式-https改为ssh

git clone git://git.openwrt.org/feed/packages.git

修改feeds.conf.default配置

src-git packages git://git.openwrt.org/feed/packages.git
src-git luci https://git.openwrt.org/project/luci.git
src-git routing https://git.openwrt.org/feed/routing.git
src-git telephony https://git.openwrt.org/feed/telephony.git
#src-git video https://github.com/openwrt/video.git
#src-git targets https://github.com/openwrt/targets.git
#src-git management https://github.com/openwrt-management/packages.git
#src-git oldpackages http://git.openwrt.org/packages.git
#src-link custom /usr/src/openwrt/custom-feed

好了,现在可以重新再执行编译脚本一遍:./lite/tools/build_linux.sh --arch=armv7hf --with_python=ON

配置好以后如果还是连不上,多重新几次,亲测有效,这个方法我觉的比修改dns管用。)

(漫长的编译等待...)

三、安装Paddle-Lite

inference_lite_lib.armlinux.armv7hf/
|-- cxx                                     C++ 预测库和头文件
|   |-- include                             C++ 头文件
|   |   |-- paddle_api.h
|   |   |-- paddle_image_preprocess.h
|   |   |-- paddle_lite_factory_helper.h
|   |   |-- paddle_place.h
|   |   |-- paddle_use_kernels.h
|   |   |-- paddle_use_ops.h
|   |   `-- paddle_use_passes.h
|   `-- lib                                 C++预测库
|       |-- libpaddle_api_light_bundled.a   C++静态库
|       `-- libpaddle_light_api_shared.so   C++动态库
|
|-- demo                          
|   `-- python                              python预测库demo
|
|-- python                                  Python预测库(需要打开with_python选项)
|   |-- install
|   |   `-- dist
|   |       `-- paddlelite-*.whl            python whl包 
|   |-- lib
|       `-- lite.so                     

先进入paddlelite-*.whl文件目录里:

 cd    build.lite.linux.armv7hf.gcc/inference_lite_lib.armlinux.armv7hf/python/install/dist

直接安装 

pip3 install paddlelite-*.whl

安装完成后验证是否成功

进入python程序:

python

执行以下命令:

import paddlelite

import paddlelite.lite

第一阶段总结:完成以上部署,系统环境部分就算是完成了,希望我们国家能够放开对github的限制,研发人员人生苦短!同时也希望百度的技术人员能够把官方手册写的更完善,不要学msdn!