树莓派4B安装 百度飞桨paddlelite 做视频检测 (一、环境安装)
前言:
当前准备重新在树莓派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 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
估计你跟我最初一样会报错,耗费了很长时间才搞定,后面必须加参数:
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 Paddle-Lite/build.lite.linux.armv7hf.gcc/inference_lite_lib.armlinux.armv7hf/python/install/dist/
直接安装
pip3 install paddlelite-*.whl
安装完成后验证是否成功
import paddlelite
或
import paddlelite.lite
第一阶段总结:完成以上部署,系统环境部分就算是完成了,希望我们国家能够放开对github的限制,研发人员人生苦短!同时也希望百度的技术人员能够把官方手册写的更完善,不要学msdn!
树莓派4B安装 百度飞桨paddlelite 做视频检测 (一、环境安装)的更多相关文章
- Ubuntu 百度飞桨和 CUDA 的安装
Ubuntu 百度飞桨 和 CUDA 的安装 1.简介 本文主要是 Ubuntu 百度飞桨 和 CUDA 的安装 系统:Ubuntu 20.04 百度飞桨:2.2 为例 2.百度飞桨安装 访问百度飞桨 ...
- 提速1000倍,预测延迟少于1ms,百度飞桨发布基于ERNIE的语义理解开发套件
提速1000倍,预测延迟少于1ms,百度飞桨发布基于ERNIE的语义理解开发套件 11月5日,在『WAVE Summit+』2019 深度学习开发者秋季峰会上,百度对外发布基于 ERNIE 的语义理解 ...
- 百度飞桨数据处理 API 数据格式 HWC CHW 和 PIL 图像处理之间的关系
使用百度飞桨 API 例如:Resize Normalize,处理数据的时候. Resize:如果输入的图像是 PIL 读取的图像这个数据格式是 HWC ,Resize 就需要 HWC 格式的数据. ...
- CentOS6.5下安装JDK1.7+MYSQL5.5+TOMCAT7+nginx1.7.5环境安装文档
----------------CentOS6.5下安装JDK1.7+MYSQL5.5+TOMCAT7+nginx1.7.5环境安装文档----------------------- [JDK1.7安 ...
- 【百度飞桨】手写数字识别模型部署Paddle Inference
从完成一个简单的『手写数字识别任务』开始,快速了解飞桨框架 API 的使用方法. 模型开发 『手写数字识别』是深度学习里的 Hello World 任务,用于对 0 ~ 9 的十类数字进行分类,即输入 ...
- centos8上安装ffmpeg4.2.2并做视频截图
一,ffmpeg的作用: FFmpeg是一套可以用来记录.转换数字音频.视频,并能将其转化为流的开源计算机程序. 它提供了录制.转换以及流化音视频的完整解决方案.它包含了非常先进的音频/视频编解码库l ...
- drupal7 安装百度编辑器Ueditor及后续使用
参考文章:drupal7安装百度编辑器ueditor 一.下载 1.需要下载安装的模块: 1.1.wysiwyg 1.2.ueditor 1.3Libraries 下载后安装在\sites\all\m ...
- ELK-6.5.3学习笔记–elk基础环境安装
本文预计阅读时间 13 分钟 文章目录[隐藏] 1,准备工作. 2,安装elasticsearch. 3,安装logstash. 4,安装kibana 以往都是纸上谈兵,毕竟事情也都由部门其他小伙伴承 ...
- 001_HyperLedger Fabric环境安装
HyperLedger Fabric的环境,有解决三大问题 第一,是系统环境,这里我们选择的是centos7 第二,是开发环境,这里我们选择的是Go语言 第三,是运行环境,这里我们选择的是Docker ...
随机推荐
- ElementUI常遇到的一些问题
一.form 下面只有一个 input 时回车键刷新页面 原因是:触发了表单默认的提交行为,给el-form 加上 @submit.native.prevent 就行了. <el-form in ...
- 回顾 Flutter 2021 重要时刻,奉上虎年红包封面喜迎新年!
2021 年,Flutter 正式进入 2.x 系列的正式版发布,年初的 Flutter 2 的发布 打开了一个新的"格局",为 Flutter 的加入了第五大特色--「可移植性」 ...
- 右键没有word?excel?ppt?注解表该改改啦
✿[office 2019]office2010版本以上的都可以(例如:office 2010.office 2016.office 2019) 一.快速方法解决右键没有word: 在电脑桌面右键一个 ...
- React之react-router(connected-react-router/react-router-dom)
文档: react-router-dom官方文档:https://reacttraining.com/react-router/web/guides/quick-start connected-rea ...
- QA(测试) 工作准则建议
身为一个专业的 QA 当然需要有自己的测试原则,这些测试原则不仅可以帮助我们提高产品质量,对外还能体现出我们的专业性,从而让合作方后续还有意愿和我们合作. 1 测试前 1.1 需求评审 必须参与,有问 ...
- LeetCode673
LeetCode每日一题2021.9.20 LeetCode673. 最长递增子序列的个数 思路 在最长上升子序列的转移时,维护一个 cnt 数组,表示 以 i 结尾的最长上升子序列个数 f[i] 表 ...
- 解决 413 Request Entity Too Large
修改配置文件 vim /etc/nginx/sites-available/default,增加 client_max_body_size 1000m;//最大上传大小 proxy_connect_ ...
- Servlet核心内容
Servlet重要的四个生命周期方法 构造方法: 创建servlet对象的时候调用.默认情况下,第一次访问servlet的时候创建servlet对象只调用1次.证明servlet对象在tomcat是单 ...
- 关于MPMoviePlayerController 缓存播放的一些技术准备
如果是视频文件,比如Mp4,avi,rmvb等可根据下面的这边文章推荐的Demo(http://code4app.com/ios/5292c381cb7e8445678b5ac2),经过测试可以进行同 ...
- Redis 源码简洁剖析 10 - aeEventLoop 及事件
aeEventLoop IO 事件处理 IO 事件创建 读事件处理 写事件处理 时间事件处理 时间事件定义 时间事件创建 时间事件回调函数 时间事件的触发处理 参考链接 Redis 源码简洁剖析系列 ...