当前位置:网站首页>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
边栏推荐
- 1+x云计算中级--脚本搭建读写分离
- Redis transaction implements optimistic locking principle
- Chapter IV intangible assets
- Research on system and software security (4)
- GUI,CLI与Unix哲学
- Go语学习笔记 - Slice、Map | 从零开始Go语言
- Redis--为什么字符串emstr的字符串长度是44字节上限?
- Talking about distributed storage from ES, mongodb, redis and rocketmq
- C problem of marking the position of polygons surrounded by multiple rectangles
- Sto with billing cross company inventory dump return
猜你喜欢

Unity C single case mode learning review notes

Internal network security attack and defense: a practical guide to penetration testing (8): Authority maintenance analysis and defense

Chapter V investment real estate

LeetCode 1611. 使整数变为 0 的最少操作次数

输入 “ net start mysql ”,出现 “ 发生系统错误 5。 拒绝访问 ” 。问题详解

Ribbon start process

SAP GUI security

BUFFCTF文件中的秘密1

Intranet penetration series: icmpsh of Intranet tunnel

內網滲透系列:內網隧道之icmpsh
随机推荐
Chapter IV intangible assets
Introduction to sap query enhanced development
攻防世界MISC刷题1-50
SAP GUI安全性
Move layout (Flex layout, viewport label)
KVM安装部署
聊聊接口幂等与消费幂等的本质
KCD_ EXCEL_ OLE_ TO_ INT_ Convert reports an error sy subrc = 2
sentinel集成nacos动态更新数据原理
Redis transaction implements optimistic locking principle
About unity to obtain links related to the transformation of real geographic maps into 3D
Post of experience in preparation for guarantee and research -- the 18th (2021) Central South planning department promoted the exemption to Zhejiang University Institute of Technology
內網滲透系列:內網隧道之icmpsh
1+x云计算中级--脚本搭建读写分离
Search and replacement of C text file (WinForm)
upload-labs 靶场练习
strcat()、strcpy()、strcmp()、strlen()
Talking about distributed storage from ES, mongodb, redis and rocketmq
Buuctf misc brush questions
C problem of marking the position of polygons surrounded by multiple rectangles