当前位置:网站首页>Jetson Xavier NX(3)Bazel Mediapipe 安装
Jetson Xavier NX(3)Bazel Mediapipe 安装
2022-04-23 06:41:00 【Nysun11】
一、安装 Bazel
1 - 下载
2 - 拷贝过去解压
3 - 安装依赖
sudo apt-get install build-essential openjdk-8-jdk
如果定位不到 openjdk-8-jdk 应该是 apt 源的问题,自己修改一下,可以参考我之前的博客内容
4 - 编译
env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh
会比较久,耐心等待(开启最大性能模式)
5 - 将生成的bazel文件放在PATH目录中
sudo cp output/bazel /usr/local/bin/
检查一下
bazel --version
二、Mediapipe安装
1 - 下载
git clone https://github.com/google/mediapipe.git
2 - 上传解压
3 - 安装依赖
sudo apt install -y python3-dev
sudo apt install -y cmake
4 - 删除非必要模块
进入 mediapipe 文件夹下,删除不必要的模块和标志
cd mediapipe
sed -i -e "/\"imgcodecs\"/d;/\"calib3d\"/d;/\"features2d\"/d;/\"highgui\"/d;/\"video\"/d;/\"videoio\"/d" third_party/BUILD
sed -i -e "/-ljpeg/d;/-lpng/d;/-ltiff/d;/-lImath/d;/-lIlmImf/d;/-lHalf/d;/-lIex/d;/-lIlmThread/d;/-lrt/d;/-ldc1394/d;/-lavcodec/d;/-lavformat/d;/-lavutil/d;/-lswscale/d;/-lavresample/d" third_party/BUILD
5 - 修改 BUILD 文件
打开/mediapipe/third_party/BUILD
#定位到
“WITH_WEBP”: “OFF”,
# 在后面增加以下两句内容:
“ENABLE_NEON”: “OFF”,
“WITH_TENGINE”: “OFF”,
6 - 修改OpenCV和FFMpeg的编译文件
在 mediapipe 下执行如下代码
sed -i "s/x86_64-linux-gnu/aarch64-linux-gnu/g" third_party/opencv_linux.BUILD
sed -i "s/x86_64-linux-gnu/aarch64-linux-gnu/g" third_party/ffmpeg_linux.BUILD
7 - 安装编译器protobuf-compiler
下载,注意是 linux-aarch64.zip结尾
然后将protobuf-compilerv3.19.1中的“bin”和include下的“google”复制到 mediapipe 下 并修改mediapipe/setup.py
protoc_command = [self._protoc, ‘-I.’, ‘–python_out=.’, source]
修改为:(注意符号英文格式)
protoc_command = [self._protoc, ‘-I.’, ‘-I/usr/local/include’,’–python_out=.’, source]
8 - gcc版本是否是8,如果不是请升级(不升级会报错,都是泪啊,请务必升级)
sudo apt-get update
sudo apt-get install gcc-8
sudo apt-get install g++-8
cd /usr/bin
sudo rm gcc g++
sudo ln -s gcc-8 gcc
sudo ln -s g++-8 g++
如果报错在回来升级gcc,继续执行编译文件的话,又会报错 this rule is missing dependency declarations for the following fles 清理缓存继续:
sudo rm -rf ~/.cache/bazel/
9 - 编译
尽可能使用科学上网
,否则下载包会中断什么的,耐心重试吧…
在 mediapipe 下执行:
python3 setup.py gen_protos && python3 setup.py bdist_wheel
等很久之后会在一个 dist 文件夹生成 .whl 文件
10 - install
进入到你的虚拟环境(如果有)
pip install *****.whl
写在最后:
整个流程断断续续很多次,参考了好几篇文章,表示感谢
我试图在电脑端科学上网然后开 WiFi 给开发板,事实证明这样是不行滴
我用的 python36 如果有朋友想要我的 whl 可以私信或是留言
版权声明
本文为[Nysun11]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_38773342/article/details/124231352
边栏推荐
- MYSQL——第一章节(数据类型2)
- Redis事务实现乐观锁原理
- Intranet penetration series: icmptunnel of Intranet tunnel (Master James Barlow's)
- 爬虫学习笔记,学习爬虫,看本篇就够了
- Intranet security attack and defense: a practical guide to penetration testing (6): domain controller security
- Chapter VII asset impairment
- Redis transaction implements optimistic locking principle
- 内网渗透系列:内网隧道之icmp_tran
- MySQL——第一章节(MySQL中的数据类型)
- Personality charm of high paid it workers
猜你喜欢
Sto with billing cross company inventory dump return
Go语学习笔记 - 结构体 | 从零开始Go语言
[programming practice / embedded competition] learning record of embedded competition (I): establishment of TCP server and web interface
Unity C single case mode learning review notes
feign如何集成hystrix
sentinel集成nacos动态更新数据原理
SAP GUI安全性
数据库之Mysql——概述安装篇
第五章 投资性房地产
内网渗透系列:内网隧道之icmp_tran
随机推荐
Talk about the essence of interface idempotent and consumption idempotent
Go语学习笔记 - Slice、Map | 从零开始Go语言
C problem of marking the position of polygons surrounded by multiple rectangles
Internal network security attack and defense: a practical guide to penetration testing (VII): cross domain attack analysis and defense
sentinel集成nacos动态更新数据原理
数据库之Mysql——概述安装篇
KVM安装部署
[programming practice / embedded competition] learning record of embedded competition (I): establishment of TCP server and web interface
Cloud computing skills competition -- the first part of openstack private cloud environment
一文了解系列,对web渗透的常见漏洞总结(持续更新)
TA notes of Zhuang understand (zero) < bedding and learning methods >
strcat()、strcpy()、strcmp()、strlen()
Essays (updated from time to time)
Research on software security based on NLP (I)
Research on system and software security (5)
When using flash, the code ends automatically without an error, the connection cannot be maintained, and the URL cannot be accessed.
Alibaba sentinel学习QA
Internal network security attack and defense: a practical guide to penetration testing (8): Authority maintenance analysis and defense
String self generated code within a given range
Go语学习笔记 - 结构体 | 从零开始Go语言