极智AI | 比特大陆 SE5 边缘盒子 caffe SSD 量化与转换部署模型
上位机在google chrome中打开: 192.168.150.1
。
默认账号密码
账号:admin
密码:admin
账号:192.168.150.1
密码:linaro
官网已经上线 云课堂:
算法移植快速入门,请关注以下视频:
开发文档
BM1684 BMNNSDK2 用户手册
SE5用户手册
SOPHON下载中心
PaddleOCR-BM1684Demo
SophonSilk 官方 github 例程
开发环境,是指用于模型转换或验证以及程序编译等开发过程的环境;运行环境,是指在具备Sophon设备的平台上实际使用设备进行算法应用部署的运行环境。
开发环境与运行环境肯能是统一的(如:插有SC5加速卡的x86主机,既是开发环境又是运行环境),也可能是分离的(如:使用x86主机作为开发环境转换模型和编译程序,使用SE5盒子部署运行最终的算法应用)。但是,无论是使用Soc模式还是PCIE模式,均需要一台x86主机作为开发环境。
如果是 PCIE模式,需要将PCIE加速卡插到主机中,在宿主机上安装驱动程序,然后按照指引配置docker环境,这个环境既是开发环境也是运行环境。当然,也可以基于我们提供的docker开发环境,只保留系统运行时库的相关包,并添加需要的库包以及其他程序代码,构建自己部署在生产环境中的docker镜像。
如果是 Soc模式,需要按照指引配置docker环境,docker将工作在CModel模式,提供模型转换和程序交叉编译的开发环境;待程序编译好后,需要手动将编译好的程序拷贝到目标系统(SE5/SM5)中运行执行。
对于SoC平台,内部已经集成了相应的SDK运行库包,位于/system目录下,只需设置环境变量即可。
# 设置环境变量
export PATH=$PATH:/system/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/system/lib/:/system/usr/lib/aarch64-linux-gnu
export PYTHONPATH=$PYTHONPATH:/system/lib
linaro@seeking:/system/bin$ ls -l
total 206640
-rwxr-xr-x 1 linaro linaro 16299496 Mar 22 2021 bm-smi
-rwxr-xr-x 1 linaro linaro 594240 Mar 22 2021 bm_model.bin
-rwxr-xr-x 1 linaro linaro 31152 Mar 22 2021 bm_test
-rwxr-xr-x 1 linaro linaro 34920 Mar 22 2021 bmcv-vpp-test
-rwxr-xr-x 1 linaro linaro 21408 Mar 22 2021 bmjpegdec
-rwxr-xr-x 1 linaro linaro 21848 Mar 22 2021 bmjpegenc
-rwxr-xr-x 1 linaro linaro 37216 Mar 22 2021 bmjpegmulti
-rwxr-xr-x 1 linaro linaro 204600 Mar 22 2021 bmrt_test
-rwxr-xr-x 1 linaro linaro 38112 Mar 22 2021 bmvpuenc
-rwxr-xr-x 1 linaro linaro 38560 Mar 22 2021 cvtcolortest
-rwxr-xr-x 1 linaro linaro 5504656 Mar 22 2021 fbcmulti
-rwxr-xr-x 1 linaro linaro 4934680 Mar 22 2021 fbd_matrix
-rwxr-xr-x 1 linaro linaro 236320 Mar 22 2021 ffmpeg
-rwxr-xr-x 1 linaro linaro 134656 Mar 22 2021 ffprobe
-rwxr-xr-x 1 linaro linaro 26352 Mar 22 2021 freetype_demo
-rwxr-xr-x 1 linaro linaro 4933720 Mar 22 2021 i420tonv12
-rwxr-xr-x 1 linaro linaro 30824 Mar 22 2021 jpubasic
-rwxr-xr-x 1 linaro linaro 35848 Mar 22 2021 jpumulti
-rwxr-xr-x 1 linaro linaro 50440 Mar 22 2021 ocv-drawing
-rwxr-xr-x 1 linaro linaro 42136 Mar 22 2021 opencv_annotation
-rwxr-xr-x 1 linaro linaro 40792 Mar 22 2021 opencv_bmcv
-rwxr-xr-x 1 linaro linaro 170664 Mar 22 2021 opencv_interactive-calibration
-rwxr-xr-x 1 linaro linaro 42360 Mar 22 2021 opencv_version
-rwxr-xr-x 1 linaro linaro 59752 Mar 22 2021 opencv_visualisation
-rwxr-xr-x 1 linaro linaro 670 Mar 22 2021 setup_vars_opencv4.sh
-rwxr-xr-x 1 linaro linaro 29072 Mar 22 2021 test_bm_restart
-rwxr-xr-x 1 linaro linaro 24936 Mar 22 2021 test_bmvpp
-rwxr-xr-x 1 linaro linaro 33936 Mar 22 2021 test_ff_bmjpeg
-rwxr-xr-x 1 linaro linaro 22888 Mar 22 2021 test_ff_libyuv
-rwxr-xr-x 1 linaro linaro 78544 Mar 22 2021 test_ff_transcode_dll
-rwxr-xr-x 1 linaro linaro 106125280 Mar 22 2021 test_ff_transcode_static
-rwxr-xr-x 1 linaro linaro 25776 Mar 22 2021 test_ff_video_encode
-rwxr-xr-x 1 linaro linaro 38984 Mar 22 2021 test_ff_video_scale
-rwxr-xr-x 1 linaro linaro 33264 Mar 22 2021 test_ff_video_xcode
-rwxr-xr-x 1 linaro linaro 19024 Mar 22 2021 test_ion
-rwxr-xr-x 1 linaro linaro 34864 Mar 22 2021 test_libyuv
-rwxr-xr-x 1 linaro linaro 28144 Mar 22 2021 test_ocv_bmcv
-rwxr-xr-x 1 linaro linaro 27432 Mar 22 2021 test_ocv_jpubasic
-rwxr-xr-x 1 linaro linaro 33792 Mar 22 2021 test_ocv_jpumulti
-rwxr-xr-x 1 linaro linaro 26104 Mar 22 2021 test_ocv_vidbasic
-rwxr-xr-x 1 linaro linaro 24792 Mar 22 2021 test_ocv_video_xcode
-rwxr-xr-x 1 linaro linaro 32832 Mar 22 2021 test_ocv_vidmulti
-rwxr-xr-x 1 linaro linaro 30784 Mar 22 2021 vidbasic
-rwxr-xr-x 1 linaro linaro 25832 Mar 22 2021 vidcamera
-rwxr-xr-x 1 linaro linaro 30456 Mar 22 2021 videotranscode
-rwxr-xr-x 1 linaro linaro 45960 Mar 22 2021 vidmulti
-rwxr-xr-x 1 linaro linaro 4933680 Mar 22 2021 vpp_border
-rwxr-xr-x 1 linaro linaro 4933840 Mar 22 2021 vpp_border_with_devfd
-rwxr-xr-x 1 linaro linaro 4938408 Mar 22 2021 vpp_cmodel
-rwxr-xr-x 1 linaro linaro 4939232 Mar 22 2021 vpp_convert
-rwxr-xr-x 1 linaro linaro 4934000 Mar 22 2021 vpp_cropmulti
-rwxr-xr-x 1 linaro linaro 4960560 Mar 22 2021 vpp_cropsingle
-rwxr-xr-x 1 linaro linaro 4937912 Mar 22 2021 vpp_iondemo
-rwxr-xr-x 1 linaro linaro 4934448 Mar 22 2021 vpp_matrix
-rwxr-xr-x 1 linaro linaro 4960064 Mar 22 2021 vpp_misc
-rwxr-xr-x 1 linaro linaro 5489520 Mar 22 2021 vpp_multi
-rwxr-xr-x 1 linaro linaro 4934032 Mar 22 2021 vpp_resize
-rwxr-xr-x 1 linaro linaro 4933680 Mar 22 2021 vpp_split
-rwxr-xr-x 1 linaro linaro 20808 Mar 22 2021 vppborder
-rwxr-xr-x 1 linaro linaro 25120 Mar 22 2021 vppcrop
-rwxr-xr-x 1 linaro linaro 4961448 Mar 22 2021 vppfbd_crop
-rwxr-xr-x 1 linaro linaro 4934128 Mar 22 2021 vppfbd_csc_resize
-rwxr-xr-x 1 linaro linaro 44256 Mar 22 2021 vppmulti
-rwxr-xr-x 1 linaro linaro 20880 Mar 22 2021 vppresize
-rwxr-xr-x 1 linaro linaro 20624 Mar 22 2021 vppsplit
-rwxr-xr-x 1 linaro linaro 25264 Mar 22 2021 vppvideo
-rwxr-xr-x 1 linaro linaro 15872 Mar 22 2021 vpuinfo
-rwxr-xr-x 1 linaro linaro 16472 Mar 22 2021 vpureset
-rwxr-xr-x 1 linaro linaro 1190920 Mar 22 2021 w5_enc_test
# 查看TPU占用情况
bm-smi
如果直接用物理机作为上位机,不需要设置VMware虚拟机IP,其他操作步骤将会简化。
博主用VMware虚拟机作为 X86虚拟机,SE5盒子、X86上位机、VMnet8、虚拟机都有IP。
SE5盒子IP:192.168.150.1
X86上位机IP:192.168.150.2
VMware Virtual Ethernet Adapter for VMnet8:192.168.150.3
虚拟机IP:192.168.32.128
设置VMware Virtual Ethernet Adapter的IP
SE5盒子默认预置了人脸抓拍识别的应用,如果想关闭预置的算法应用,先ssh登录到盒子终端,再执行命令关闭。
# ssh 登录盒子终端,默认用户名和密码均为 linaro
ssh linaro@<SE5_IP>
# 盒子终端内部
cd /bm_bin
./bm_switch2box
# 执行后盒子将自动重启
# 如果想启动默认的算法应用,请重新进行SD卡刷机。
注意:SE5盒子自带的操作系统并没有桌面系统;只预置了人脸抓拍识别应用的盒子才带有webUI界面,HDMI接口有信号输出;官网提供的MicroSD卡刷机包为干净系统的卡刷机包,不带人脸抓拍识别应用,HDMI接口无信号输出,不带webUI界面。
执行指令bm_switch2box
,会移除HDMI输出,导致插入HDMI显示器没有输出。所以,慎重执行该指令。
用fizila工具传输,或者用scp指令拷贝。
scp ssd300_cv_bmcv_bmrt.arm [email protected]:/data/ssd_object_demo/
scp out/fp32_ssd300.bmodel [email protected]:/data/ssd_object_demo/
对于基于深度学习的视频/图片分析任务来说,通常都包括如下几个步骤:
BM1684中除了张量运算硬件加速单元TPU外,还集成了针对编解码、图像处理等操作的若干硬件加速模块,用户通过BMNNSDK中提供的相应的软件接口库,可以对以上几个步骤进行针对性地加速,从而便捷地开发出高效的算法和应用。
Quantization-Tools
升级方式
升级版本
V5R7C01版本下载地址链接:https://pan.baidu.com/s/18mfh6Wke1rzspRdYFepOQw 提取码:hwm1
重要说明:VMware硬盘可用空间大于25GB(解压文件和加载docker镜像占用空间较大)。
---》编辑
---》 虚拟网络编辑器
---》 添加网络
---》 VMnet8
---》更改设置
---》NAT模式
---》 NAT设置
---》设置网关IP
---》 设置子网IP
---》 设置子网掩码
==添加网络,会自动生成子网地址,比如:192.168.32.0。==网关IP与子网IP在同一个网段。
子网IP:`192.168.32.0`
子网掩码:`255.255.255.0`
网关IP:`192.168.32.1`
LAN口直连说明:
1)将盒子的LAN口与电脑网口直接用网线连接在一起
2)LAN口默认的IP配置:
inet 192.168.150.1 netmask 255.255.255.0
3)将电脑的网口设置成如下:
inet 192.168.150.2 netmask 255.255.255.0
4)在电脑上使用ssh登陆:ssh [email protected] 密码:linaro
用网线,将SE5的LAN网口与上位机网口连接;默认通过 LAN 口登录 LiteOS 系统。
---》网络和Internet设置
---》 更改适配器选项
---》 以太网
---》 右键属性
---》 Internet协议版本4(TCP/IPv4)
---》 属性
---》 使用下面的IP地址(S)
---》 确定
---》 确定
IP地址(I):`192.168.150.2`
子网掩码(U):`255.255.255.0`
上位机用浏览器访问 192.168.150.1
进入LiteOS 系统,修改配置。当LAN IP设置好之后,修改WAN IP。
当WAN IP修改完之后,将SE5的WAN网口与交换机LAN网口连接,上位机网口连接交换机LAN网口。或者,将SE5的WAN网口与路由器LAN网口连接(此时路由器相当于交换机),上位机网口连接路由器LAN网口。
在X86上位机
BM1684-ubuntu-docker 镜像
bmnnsdk2-bm1684-ubuntu-docker-py37.zip
# 解压到
/home/yoyo/bmnnsdk2
yoyo@ubuntu:~/bmnnsdk2/bmnnsdk2-bm1684-ubuntu-docker-py37$ tree -L 3.
├── bmnnsdk2-bm1684-ubuntu.docker # 镜像文件
├── bmnnsdk2.MD5
├── Dockerfile.bm1684
└── release_version.txt
0 directories, 4 files
在X86上位机
bmnnSDK
bmnnsdk2_bm1684_v2.7.0_20220316_patched.zip
# 解压到
/home/yoyo/bmnnsdk2
yoyo@ubuntu:~/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched$ tree -L 3
.
├── bmnnsdk2-bm1684_v2.7.0.tar.gz # bmnnsdk2压缩包
├── bmnnsdk2.MD5
└── release_version.txt
0 directories, 3 files
# 解压
cd /home/yoyo/bmnnsdk2
tar zxf ./bmnnsdk2-bm1684_v2.7.0.tar.gz
bmnnsdk2-bm1684_v2.7.0.tar.gz
# 解压到
/home/yoyo/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched
yoyo@ubuntu:~/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched$ tree -L 2
.
├── bmnnsdk2-bm1684_v2.7.0 # 解压后
│ ├── bin
│ ├── bmlang
│ ├── bmnet
│ ├── docker_run_bmnnsdk.sh
│ ├── documents
│ ├── driver
│ ├── examples
│ ├── include
│ ├── install
│ ├── lib
│ ├── release_version.txt
│ ├── res
│ ├── scripts
│ └── test
├── bmnnsdk2-bm1684_v2.7.0.tar.gz # bmnnsdk2压缩包
├── bmnnsdk2.MD5
└── release_version.txt
examples
参考样例简介$(BMNNSDK)/examples
下提供了编解码、模型转换、模型量化、推理等方面的一系列的样例程序可供参考,更多样例持续更新中。
yoyo@ubuntu:~/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched/bmnnsdk2-bm1684_v2.7.0$ tree -L 2
.
├── examples
│ ├── calibration # 模型量化
│ ├── centernet
│ ├── multimedia # 多媒体(视频及图片编解码、格式转换)
│ ├── nntc # NNToolChain工具套件,提供模型转换(bmnetc、bmnetd、bmnetm、bmnetp、bmnett、bmnetu、bmtflite及bmruntime的使用)
│ ├── okkernel # OKKernel编程
│ ├── Resnet_classify # 使用Restnet进行图像分类
│ ├── RetinaFace
│ ├── sail # SAIL模块
│ ├── SSD_object # 使用SSD模型进行目标检测
│ ├── YOLOv3_object # 使用YOLOv3进行目标检测
│ ├── YOLOv5_object # 使用YOLOv5进行目标检测
│ └── YOLOX_object
在X86上位机
量化使用的图片集数据:VOC712.tgz, 下载Password:nl7v。
下载链接:https://pan.baidu.com/s/1o9e7uqKBFx0MODssm4JdiQ
Password:nl7v
tar zxf /home/yoyo/bmnnsdk2/VOC712.tgz -C ./examples/SSD_object/model/data/
VOC712.tgz
# 解压到
/home/yoyo/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched/bmnnsdk2-bm1684_v2.7.0/examples/SSD_object/model/data/
yoyo@ubuntu:~/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched/bmnnsdk2-bm1684_v2.7.0/examples/SSD_object/model/data$ tree -L 2
.
└── VOC0712
├── data.mdb
├── labelmap_voc.prototxt
└── lock.mdb
在X86上位机
原始 SSD Caffe 模型数据,models_VGGNet_VOC0712_SSD_300x300.tar.gz
。
下载链接:https://pan.baidu.com/s/1pLxeLaVoisqN7IVyfrNhag
Password: i4x9
cp /home/yoyo/bmnnsdk2/models_VGGNet_VOC0712_SSD_300x300.tar.gz
./examples/SSD_object/model/
models_VGGNet_VOC0712_SSD_300x300.tar.gz
# 拷贝到
/home/yoyo/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched/bmnnsdk2-bm1684_v2.7.0/examples/SSD_object/model/
yoyo@ubuntu:~/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched/bmnnsdk2-bm1684_v2.7.0/examples/SSD_object/model$ tree -L 1
.
├── data
├── download_ssd_model.sh
├── gen_bmodel.sh
├── gen_umodel_int8bmodel.sh
├── models_VGGNet_VOC0712_SSD_300x300.tar.gz # 模型文件
├── README.md
└── ssd300_umodel.prototxt
1 directory, 6 files
在SE5盒子
# 登录到SE5
ssh [email protected]
密码:linaro
# 创建ssd_object_demo目录
mkdir -p /data
mkdir -p /data/ssd_object_demo
官方推荐的安装方式
安装Docker软件包
sudo apt-get install docker.io
载入docker镜像
cd /home/yoyo/bmnnsdk2/bmnnsdk2-bm1684-ubuntu-docker-py37
sudo docker load -i ./bmnnsdk2-bm1684-ubuntu.docker
cd bmnnsdk2-bm1684_v2.7.0
sudo ./docker_run_bmnnsdk.sh
# 运行成功后,提示:
root@ubuntu:/workspace#
yoyo@ubuntu:~/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched/bmnnsdk2-bm1684_v2.7.0$ sudo ./docker_run_bmnnsdk.sh
[sudo] password for yoyo:
/home/yoyo/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched/bmnnsdk2-bm1684_v2.7.0
/home/yoyo/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched/bmnnsdk2-bm1684_v2.7.0
bmnnsdk2-bm1684/dev:ubuntu16.04
docker run --network=host --workdir=/workspace --privileged=true -v /home/yoyo/bmnnsdk2/bmnnsdk2_bm1684_v2.7.0_20220316_patched/bmnnsdk2-bm1684_v2.7.0:/workspace -v /dev/shm --tmpfs /dev/shm:exec -v /etc/localtime:/etc/localtime -e LOCAL_USER_ID=0 -it bmnnsdk2-bm1684/dev:ubuntu16.04 bash
root@ubuntu:/workspace#
nntc即NNToolChain工具套件,提供了bmnetc、bmnetd、bmneto、bmnetp、bmnett、bmnetu等工具,分别用来转换Caffe、Darknet、MXNet、ONNX、Pytorch、Tensorflow、UFramework(算能科技自定义的模型中间格式框架)等框架下的模型。经前端工具解析后,模型编译器BMNet Compiler 会对各种框架的模型进行离线转换,生成 TPU 能够执行的指令流,并序列化保存为 BModel 文件;当执行在线推理时,由 BMRuntime负责BModel模型的读取、数据的拷贝传输、TPU推理的执行,以及计算结果的读取等。
cd ./scripts
./install_lib.sh nntc
root@ubuntu:/workspace/scripts# ./install_lib.sh nntc
linux is Ubuntu16.04.5LTS\n\l
bmnetc and bmlang USING_CXX11_ABI=1
Install lib done !
cd ./scripts
source envsetup_cmodel.sh
root@ubuntu:/workspace/scripts# source envsetup_cmodel.sh
/workspace/scripts /workspace/scripts
numpy version: 1.21.5
local numpy ver=1.21.5,require ver=1.14.6
/workspace/bmnet/bmlog /workspace/scripts
WARNING: Skipping bmlog as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple bmlog-1.0.4-py2.py3-none-any.whl --user
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./bmlog-1.0.4-py2.py3-none-any.whl
Installing collected packages: bmlog
Successfully installed bmlog-1.0.4
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/bmnet/bmnetc /workspace/scripts
WARNING: Skipping bmnetc as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple bmnetc-2.7.0-py2.py3-none-any.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./bmnetc-2.7.0-py2.py3-none-any.whl
Installing collected packages: bmnetc
Successfully installed bmnetc-2.7.0
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/bmnet/bmnetm /workspace/scripts
WARNING: Skipping bmnetm as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple bmnetm-2.7.0-py2.py3-none-any.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./bmnetm-2.7.0-py2.py3-none-any.whl
Requirement already satisfied: mxnet>=1.6.0 in /usr/local/lib/python3.7/site-packages (from bmnetm==2.7.0) (1.6.0)
Requirement already satisfied: requests<3,>=2.20.0 in /usr/local/lib/python3.7/site-packages (from mxnet>=1.6.0->bmnetm==2.7.0) (2.27.1)
Requirement already satisfied: graphviz<0.9.0,>=0.8.1 in /usr/local/lib/python3.7/site-packages (from mxnet>=1.6.0->bmnetm==2.7.0) (0.8.4)
Requirement already satisfied: numpy<2.0.0,>1.16.0 in /usr/local/lib/python3.7/site-packages (from mxnet>=1.6.0->bmnetm==2.7.0) (1.21.5)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.7/site-packages (from requests<3,>=2.20.0->mxnet>=1.6.0->bmnetm==2.7.0) (1.26.8)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/site-packages (from requests<3,>=2.20.0->mxnet>=1.6.0->bmnetm==2.7.0) (2021.10.8)
Requirement already satisfied: charset-normalizer~=2.0.0 in /usr/local/lib/python3.7/site-packages (from requests<3,>=2.20.0->mxnet>=1.6.0->bmnetm==2.7.0) (2.0.12)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.7/site-packages (from requests<3,>=2.20.0->mxnet>=1.6.0->bmnetm==2.7.0) (3.3)
Installing collected packages: bmnetm
Successfully installed bmnetm-2.7.0
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/bmnet/bmnett /workspace/scripts
WARNING: Skipping bmnett as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple bmnett-2.7.0-py2.py3-none-any.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./bmnett-2.7.0-py2.py3-none-any.whl
Installing collected packages: bmnett
Successfully installed bmnett-2.7.0
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/bmnet/bmpaddle /workspace/scripts
WARNING: Skipping bmpaddle as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple bmpaddle-2.7.0-py2.py3-none-any.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./bmpaddle-2.7.0-py2.py3-none-any.whl
Installing collected packages: bmpaddle
Successfully installed bmpaddle-2.7.0
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/bmnet/bmtflite /workspace/scripts
WARNING: Skipping bmtflite as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple bmtflite-2.7.0-py2.py3-none-any.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./bmtflite-2.7.0-py2.py3-none-any.whl
Installing collected packages: bmtflite
Successfully installed bmtflite-2.7.0
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/bmnet/bmnetp /workspace/scripts
WARNING: Skipping bmnetp as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple bmnetp-2.7.0-py2.py3-none-any.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./bmnetp-2.7.0-py2.py3-none-any.whl
Requirement already satisfied: scipy in /usr/local/lib/python3.7/site-packages (from bmnetp==2.7.0) (1.7.3)
Requirement already satisfied: numpy<1.23.0,>=1.16.5 in /usr/local/lib/python3.7/site-packages (from scipy->bmnetp==2.7.0) (1.21.5)
Installing collected packages: bmnetp
Successfully installed bmnetp-2.7.0
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/bmnet/bmnetu /workspace/scripts
WARNING: Skipping bmnetu as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple bmnetu-2.7.0-py2.py3-none-any.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./bmnetu-2.7.0-py2.py3-none-any.whl
Installing collected packages: bmnetu
Successfully installed bmnetu-2.7.0
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/bmnet/bmnetd /workspace/scripts
WARNING: Skipping bmnetd as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple bmnetd-2.7.0-py2.py3-none-any.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./bmnetd-2.7.0-py2.py3-none-any.whl
Installing collected packages: bmnetd
Successfully installed bmnetd-2.7.0
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/bmnet/bmneto /workspace/scripts
WARNING: Skipping bmneto as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple bmneto-2.7.0-py2.py3-none-any.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./bmneto-2.7.0-py2.py3-none-any.whl
Requirement already satisfied: protobuf>=3.8.0 in /usr/local/lib/python3.7/site-packages (from bmneto==2.7.0) (3.19.4)
Requirement already satisfied: onnx==1.7.0 in /usr/local/lib/python3.7/site-packages (from bmneto==2.7.0) (1.7.0)
Requirement already satisfied: onnxruntime==1.3.0 in /usr/local/lib/python3.7/site-packages (from bmneto==2.7.0) (1.3.0)
Requirement already satisfied: six in /usr/local/lib/python3.7/site-packages (from onnx==1.7.0->bmneto==2.7.0) (1.16.0)
Requirement already satisfied: numpy in /usr/local/lib/python3.7/site-packages (from onnx==1.7.0->bmneto==2.7.0) (1.21.5)
Requirement already satisfied: typing-extensions>=3.6.2.1 in /usr/local/lib/python3.7/site-packages (from onnx==1.7.0->bmneto==2.7.0) (4.1.1)
Installing collected packages: bmneto
Successfully installed bmneto-2.7.0
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/bmnet/calibration /workspace/scripts
WARNING: Skipping ufw as it is not installed.
python3 -m pip install --user -i https://mirrors.aliyun.com/pypi/simple ufw-1.0.0-py3-none-any.whl ufwio-0.9.0-py3-none-any.whl
Looking in indexes: https://mirrors.aliyun.com/pypi/simple
Processing ./ufw-1.0.0-py3-none-any.whl
Processing ./ufwio-0.9.0-py3-none-any.whl
Requirement already satisfied: python-gflags>=2.0 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (3.1.2)
Requirement already satisfied: python-dateutil>=1.4 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (2.8.2)
Collecting dash-cytoscape
Downloading https://mirrors.aliyun.com/pypi/packages/34/be/21ee645cb7943ab71b08e32c90c26c71d3d03f08e5a52c50e6e76568f0a0/dash_cytoscape-0.3.0-py3-none-any.whl (3.6 MB)
|████████████████████████████████| 3.6 MB 171 kB/s
Requirement already satisfied: leveldb>=0.191 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (0.201)
Collecting dash-draggable
Downloading https://mirrors.aliyun.com/pypi/packages/42/37/a0c8799b51fad2174dc43a1e4cc4e6d2b0de75d4624f171f3d2f88aea618/dash_draggable-0.1.2-py3-none-any.whl (173 kB)
|████████████████████████████████| 173 kB 176 kB/s
Requirement already satisfied: opencv-python>=3.0 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (4.5.5.64)
Requirement already satisfied: six>=1.1.0 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (1.16.0)
Requirement already satisfied: scipy>=0.13.2 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (1.7.3)
Requirement already satisfied: tqdm>=4.0 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (4.63.0)
Collecting ipykernel==5.3.4
Downloading https://mirrors.aliyun.com/pypi/packages/52/19/c2812690d8b340987eecd2cbc18549b1d130b94c5d97fcbe49f5f8710edf/ipykernel-5.3.4-py3-none-any.whl (120 kB)
|████████████████████████████████| 120 kB 169 kB/s
Requirement already satisfied: lmdb>=1.3.0 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (1.3.0)
Requirement already satisfied: notebook in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (6.4.10)
Collecting dash-bootstrap-components
Downloading https://mirrors.aliyun.com/pypi/packages/92/f8/78ed64a9f2bf85f8d5e6a59d7438db566d24da8ff8f3354bb51f6fdc7a45/dash_bootstrap_components-1.1.0-py3-none-any.whl (210 kB)
|████████████████████████████████| 210 kB 158 kB/s
Collecting dash-split-pane
Downloading https://mirrors.aliyun.com/pypi/packages/16/3c/4ea9adc75e5163a479c0ae291b603fd8fda03ce15ecd1bc2a3791493100a/dash_split_pane-1.0.0.tar.gz (41 kB)
|████████████████████████████████| 41 kB 7.5 kB/s
Requirement already satisfied: protobuf>=2.5.0 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (3.19.4)
Requirement already satisfied: numpy>=1.7.1 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (1.21.5)
Requirement already satisfied: nose>=1.3.0 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (1.3.7)
Requirement already satisfied: grpcio>=1.38 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (1.44.0)
Requirement already satisfied: pandas>=0.12.0 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (1.3.5)
Collecting jsonschema==3.2.0
Downloading https://mirrors.aliyun.com/pypi/packages/c5/8f/51e89ce52a085483359217bc72cdbf6e75ee595d5b1d4b5ade40c7e018b8/jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
|████████████████████████████████| 56 kB 173 kB/s
Requirement already satisfied: Cython>=0.19.2 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (0.29.28)
Collecting dash-table
Downloading https://mirrors.aliyun.com/pypi/packages/da/ce/43f77dc8e7bbad02a9f88d07bf794eaf68359df756a28bb9f2f78e255bb1/dash_table-5.0.0-py3-none-any.whl (3.9 kB)
Requirement already satisfied: plotly>=4.0 in /usr/local/lib/python3.7/site-packages (from ufw==1.0.0) (5.6.0)
Collecting dash
Downloading https://mirrors.aliyun.com/pypi/packages/8d/93/2b5f40859879a40bfb45e9e21ed4fba6e579206991e1e88e2ba0a5e43ff4/dash-2.3.1-py3-none-any.whl (9.6 MB)
|████████████████████████████████| 9.6 MB 170 kB/s
Requirement already satisfied: traitlets>=4.1.0 in /usr/local/lib/python3.7/site-packages (from ipykernel==5.3.4->ufw==1.0.0) (5.1.1)
Requirement already satisfied: jupyter-client in /usr/local/lib/python3.7/site-packages (from ipykernel==5.3.4->ufw==1.0.0) (7.1.2)
Requirement already satisfied: tornado>=4.2 in /usr/local/lib/python3.7/site-packages (from ipykernel==5.3.4->ufw==1.0.0) (6.1)
Requirement already satisfied: ipython>=5.0.0 in /usr/local/lib/python3.7/site-packages (from ipykernel==5.3.4->ufw==1.0.0) (7.32.0)
Requirement already satisfied: setuptools in /usr/local/lib/python3.7/site-packages (from jsonschema==3.2.0->ufw==1.0.0) (40.8.0)
Requirement already satisfied: pyrsistent>=0.14.0 in /usr/local/lib/python3.7/site-packages (from jsonschema==3.2.0->ufw==1.0.0) (0.18.1)
Requirement already satisfied: attrs>=17.4.0 in /usr/local/lib/python3.7/site-packages (from jsonschema==3.2.0->ufw==1.0.0) (21.4.0)
Requirement already satisfied: importlib-metadata in /usr/local/lib/python3.7/site-packages (from jsonschema==3.2.0->ufw==1.0.0) (4.11.3)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (3.0.28)
Requirement already satisfied: backcall in /usr/local/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (0.2.0)
Requirement already satisfied: pexpect>4.3 in /usr/local/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (4.8.0)
Requirement already satisfied: decorator in /usr/local/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (5.1.1)
Requirement already satisfied: jedi>=0.16 in /usr/local/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (0.18.1)
Requirement already satisfied: matplotlib-inline in /usr/local/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (0.1.3)
Requirement already satisfied: pickleshare in /usr/local/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (0.7.5)
Requirement already satisfied: pygments in /usr/local/lib/python3.7/site-packages (from ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (2.11.2)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in /usr/local/lib/python3.7/site-packages (from jedi>=0.16->ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (0.8.3)
Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/site-packages (from pandas>=0.12.0->ufw==1.0.0) (2021.3)
Requirement already satisfied: ptyprocess>=0.5 in /usr/local/lib/python3.7/site-packages (from pexpect>4.3->ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (0.7.0)
Requirement already satisfied: tenacity>=6.2.0 in /usr/local/lib/python3.7/site-packages (from plotly>=4.0->ufw==1.0.0) (8.0.1)
Requirement already satisfied: wcwidth in /usr/local/lib/python3.7/site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython>=5.0.0->ipykernel==5.3.4->ufw==1.0.0) (0.2.5)
Collecting flask-compress
Downloading https://mirrors.aliyun.com/pypi/packages/b2/95/581bc6018dcef72593ebbbb0ac84050ce97ee36fa174014145d66765552b/Flask_Compress-1.11-py3-none-any.whl (7.9 kB)
Collecting Flask>=1.0.4
Downloading https://mirrors.aliyun.com/pypi/packages/60/47/3b160a97474858486c6b6259d4cf6c0eb30e86b72014e0fe8c8ea7a22937/Flask-2.1.1-py3-none-any.whl (95 kB)
|████████████████████████████████| 95 kB 146 kB/s
Collecting dash-core-components==2.0.0
Downloading https://mirrors.aliyun.com/pypi/packages/00/9e/a29f726e84e531a36d56cff187e61d8c96d2cc253c5bcef9a7695acb7e6a/dash_core_components-2.0.0-py3-none-any.whl (3.8 kB)
Collecting dash-html-components==2.0.0
Downloading https://mirrors.aliyun.com/pypi/packages/75/65/1b16b853844ef59b2742a7de74a598f376ac0ab581f0dcc34db294e5c90e/dash_html_components-2.0.0-py3-none-any.whl (4.1 kB)
Requirement already satisfied: Werkzeug>=2.0 in /usr/local/lib/python3.7/site-packages (from Flask>=1.0.4->dash->ufw==1.0.0) (2.0.3)
Collecting itsdangerous>=2.0
Downloading https://mirrors.aliyun.com/pypi/packages/68/5f/447e04e828f47465eeab35b5d408b7ebaaaee207f48b7136c5a7267a30ae/itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Collecting click>=8.0
Downloading https://mirrors.aliyun.com/pypi/packages/a0/66/c8196ad693d62384d8e800e5bd27434a64c0057fe169b61c69a73f1614a8/click-8.1.2-py3-none-any.whl (96 kB)
|████████████████████████████████| 96 kB 178 kB/s
Requirement already satisfied: Jinja2>=3.0 in /usr/local/lib/python3.7/site-packages (from Flask>=1.0.4->dash->ufw==1.0.0) (3.0.3)
Requirement already satisfied: typing-extensions>=3.6.4 in /usr/local/lib/python3.7/site-packages (from importlib-metadata->jsonschema==3.2.0->ufw==1.0.0) (4.1.1)
Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.7/site-packages (from importlib-metadata->jsonschema==3.2.0->ufw==1.0.0) (3.7.0)
Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.7/site-packages (from Jinja2>=3.0->Flask>=1.0.4->dash->ufw==1.0.0) (2.1.1)
Collecting brotli
Downloading https://mirrors.aliyun.com/pypi/packages/15/ea/5bd575511b37bbd1c794606a0a621e6feff8e96b7dd007a86a5d218b2d94/Brotli-1.0.9-cp37-cp37m-manylinux1_x86_64.whl (357 kB)
|████████████████████████████████| 357 kB 144 kB/s
Requirement already satisfied: nest-asyncio>=1.5 in /usr/local/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.3.4->ufw==1.0.0) (1.5.4)
Requirement already satisfied: pyzmq>=13 in /usr/local/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.3.4->ufw==1.0.0) (22.3.0)
Requirement already satisfied: entrypoints in /usr/local/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.3.4->ufw==1.0.0) (0.4)
Requirement already satisfied: jupyter-core>=4.6.0 in /usr/local/lib/python3.7/site-packages (from jupyter-client->ipykernel==5.3.4->ufw==1.0.0) (4.9.2)
Requirement already satisfied: argon2-cffi in /usr/local/lib/python3.7/site-packages (from notebook->ufw==1.0.0) (21.3.0)
Requirement already satisfied: nbconvert>=5 in /usr/local/lib/python3.7/site-packages (from notebook->ufw==1.0.0) (6.4.4)
Requirement already satisfied: prometheus-client in /usr/local/lib/python3.7/site-packages (from notebook->ufw==1.0.0) (0.13.1)
Requirement already satisfied: Send2Trash>=1.8.0 in /usr/local/lib/python3.7/site-packages (from notebook->ufw==1.0.0) (1.8.0)
Requirement already satisfied: nbformat in /usr/local/lib/python3.7/site-packages (from notebook->ufw==1.0.0) (5.2.0)
Requirement already satisfied: ipython-genutils in /usr/local/lib/python3.7/site-packages (from notebook->ufw==1.0.0) (0.2.0)
Requirement already satisfied: terminado>=0.8.3 in /usr/local/lib/python3.7/site-packages (from notebook->ufw==1.0.0) (0.13.3)
Requirement already satisfied: beautifulsoup4 in /usr/local/lib/python3.7/site-packages (from nbconvert>=5->notebook->ufw==1.0.0) (4.10.0)
Requirement already satisfied: testpath in /usr/local/lib/python3.7/site-packages (from nbconvert>=5->notebook->ufw==1.0.0) (0.6.0)
Requirement already satisfied: bleach in /usr/local/lib/python3.7/site-packages (from nbconvert>=5->notebook->ufw==1.0.0) (4.1.0)
Requirement already satisfied: nbclient<0.6.0,>=0.5.0 in /usr/local/lib/python3.7/site-packages (from nbconvert>=5->notebook->ufw==1.0.0) (0.5.13)
Requirement already satisfied: mistune<2,>=0.8.1 in /usr/local/lib/python3.7/site-packages (from nbconvert>=5->notebook->ufw==1.0.0) (0.8.4)
Requirement already satisfied: pandocfilters>=1.4.1 in /usr/local/lib/python3.7/site-packages (from nbconvert>=5->notebook->ufw==1.0.0) (1.5.0)
Requirement already satisfied: defusedxml in /usr/local/lib/python3.7/site-packages (from nbconvert>=5->notebook->ufw==1.0.0) (0.7.1)
Requirement already satisfied: jupyterlab-pygments in /usr/local/lib/python3.7/site-packages (from nbconvert>=5->notebook->ufw==1.0.0) (0.1.2)
Requirement already satisfied: argon2-cffi-bindings in /usr/local/lib/python3.7/site-packages (from argon2-cffi->notebook->ufw==1.0.0) (21.2.0)
Requirement already satisfied: cffi>=1.0.1 in /usr/local/lib/python3.7/site-packages (from argon2-cffi-bindings->argon2-cffi->notebook->ufw==1.0.0) (1.15.0)
Requirement already satisfied: pycparser in /usr/local/lib/python3.7/site-packages (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi->notebook->ufw==1.0.0) (2.21)
Requirement already satisfied: soupsieve>1.2 in /usr/local/lib/python3.7/site-packages (from beautifulsoup4->nbconvert>=5->notebook->ufw==1.0.0) (2.3.1)
Requirement already satisfied: webencodings in /usr/local/lib/python3.7/site-packages (from bleach->nbconvert>=5->notebook->ufw==1.0.0) (0.5.1)
Requirement already satisfied: packaging in /usr/local/lib/python3.7/site-packages (from bleach->nbconvert>=5->notebook->ufw==1.0.0) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.7/site-packages (from packaging->bleach->nbconvert>=5->notebook->ufw==1.0.0) (3.0.7)
Building wheels for collected packages: dash-split-pane
Building wheel for dash-split-pane (setup.py) ... done
Created wheel for dash-split-pane: filename=dash_split_pane-1.0.0-py3-none-any.whl size=42684 sha256=3ecce59e8c8fd734ccd4479fd5394e8b1c1d39ee0caa77b6e3150bce140f07e2
Stored in directory: /root/.cache/pip/wheels/4a/9a/ff/e566cbea8891f85e53b717820359ce19a8669f03174723491c
Successfully built dash-split-pane
Installing collected packages: jsonschema, itsdangerous, click, Flask, brotli, flask-compress, dash-table, dash-html-components, dash-core-components, ipykernel, dash, ufwio, dash-split-pane, dash-draggable, dash-cytoscape, dash-bootstrap-components, ufw
WARNING: The script jsonschema is installed in '/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script flask is installed in '/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The scripts dash-generate-components, dash-update-components and renderer are installed in '/root/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed Flask-2.1.1 brotli-1.0.9 click-8.1.2 dash-2.3.1 dash-bootstrap-components-1.1.0 dash-core-components-2.0.0 dash-cytoscape-0.3.0 dash-draggable-0.1.2 dash-html-components-2.0.0 dash-split-pane-1.0.0 dash-table-5.0.0 flask-compress-1.11 ipykernel-5.3.4 itsdangerous-2.1.2 jsonschema-3.2.0 ufw-1.0.0 ufwio-0.9.0
WARNING: You are using pip version 20.3.4; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python3 -m pip install --upgrade pip' command.
/workspace/scripts
/workspace/scripts
root@ubuntu:/workspace/scripts#
# 在docker环境中操作
# 进入model模型路径
cd examples/SSD_object/model/
./download_ssd_model.sh
# 生成fp32_bmodel
./gen_bmodel.sh
# 查看生成的fp32_bmodel模型
ls out/
# 生成int8_bmodel模型
./gen_umodel_int8bmodel.sh
# 查看生成的int8_bmodel模型
ls out/
download_ssd_model.sh
下载预训练模型。
root@ubuntu:/workspace/examples/SSD_object/model# ./download_ssd_model.sh
File already exists! Skip downloading procedure ...
Unzipping the file...
models/VGGNet/VOC0712/SSD_300x300/
models/VGGNet/VOC0712/SSD_300x300/deploy.prototxt
models/VGGNet/VOC0712/SSD_300x300/score_ssd_pascal.py
models/VGGNet/VOC0712/SSD_300x300/solver.prototxt
models/VGGNet/VOC0712/SSD_300x300/ssd_pascal.py
models/VGGNet/VOC0712/SSD_300x300/test.prototxt
models/VGGNet/VOC0712/SSD_300x300/train.prototxt
models/VGGNet/VOC0712/SSD_300x300/VGG_VOC0712_SSD_300x300_iter_120000.caffemodel
Cleaning up...
All done!
gen_bmodel.sh
生成 FP32 模型。
root@ubuntu:/workspace/examples/SSD_object/model# ll out/
total 105184
drwxr-xr-x 4 root root 4096 Apr 11 20:38 ./
drwxrwxr-x 5 1000 1000 4096 Apr 11 20:36 ../
-rw-r--r-- 1 root root 107688928 Apr 11 20:38 fp32_ssd300.bmodel
drwxr-xr-x 2 root root 4096 Apr 11 20:36 ssd300/
drwxr-xr-x 2 root root 4096 Apr 11 20:38 ssd300_4batch/
生成的FP32模型
fp32_ssd300.bmodel
107.7MB
gen_umodel_int8bmodel.sh
生成 INT8 模型。
============================================================
*** Store bmodel of BMCompiler...
============================================================
BMLIB Send Quit Message
bmnetu ok for batch 4
Success: combined to [out/int8_ssd300.bmodel].
combine bmodel ok
生成的INT8模型
int8_ssd300.bmodel
28.9MB
生成INT8模型占用较多CPU。
cd ./example/SSD_object/cpp_cv_bmcv_bmrt
# 编译
make -f Makefile.arm
# 编译后,生成 ssd300_cv_bmcv_bmrt.arm 文件
# 将 ssd300_cv_bmcv_bmrt.arm 拷贝到SE5小盒子/data/目录下
scp ./examples/SSD_object/cpp_cv_bmcv_bmrt/ssd300_cv_bmcv_bmrt.arm [email protected]:/data/ssd_object_demo/
# 将 fp32_ssd300.bmodel 拷贝到SE5小盒子/data/目录下
scp ./examples/SSD_object/model/out/fp32_ssd300.bmodel [email protected]:/data/ssd_object_demo/
# 将 int8_ssd300.bmodel 拷贝到SE5小盒子/data/目录下
scp ./examples/SSD_object/model/out/int8_ssd300.bmodel [email protected]:/data/ssd_object_demo/
# 将测试图片 vehicle_1.jpg 拷贝到SE5小盒子/data/目录下
scp ./res/image/vehicle_1.jpg [email protected]:/data/ssd_object_demo/
# ssd300_cv_bmcv_bmrt.arm 指令用法
USAGE:
./ssd300_cv_bmcv_bmrt.arm image <image file> <bmodel path> <test count> <device id>
./ssd300_cv_bmcv_bmrt.arm video <video url> <bmodel path> <test count> <device id>
# 登录到SE5
ssh [email protected]
# 进入ssd_object_demo目录
cd /data/ssd_object_demo
# 运行测试 fp32_ssd300.bmodel
./ssd300_cv_bmcv_bmrt.arm image ./vehicle_1.jpg ./fp32_ssd300.bmodel 1 0
# 运行测试 int8_ssd300.bmodel
./ssd300_cv_bmcv_bmrt.arm image ./vehicle_1.jpg ./int8_ssd300.bmodel 1 0
# 测试的结果保存在 result 路径
/data/ssd_object_demo/results
out-batch-fp32-t_0_dev_0_vehicle_1.jpg
out-batch-int8-t_0_dev_0_vehicle_1.jpg
fp32_ssd300.bmodel
模型测试 FP32 infer,测试1次。
linaro@seeking:/data/ssd_object_demo$ ./ssd300_cv_bmcv_bmrt.arm image ./vehicle_1.jpg fp32_ssd300.bmodel 1 0
set device id:0
bmcpu init: skip cpu_user_defined
open usercpu.so, init user_cpu_init
[BMRT][load_bmodel:784] INFO : Loading bmodel from [fp32_ssd300.bmodel]. Thanks for your patience...
[BMRT][load_bmodel:748] INFO : pre net num: 0, load net num: 1
Open /dev/jpu successfully, device index = 0, jpu fd = 22, vpp fd = 23
class id: 6 upper-left: ( 652.67542, 253.06639) object-size: ( 945.39197, 676.06012)
class id: 6 upper-left: (1376.94324, 438.03113) object-size: ( 521.96301, 643.66248)
class id: 6 upper-left: ( 832.24683, 49.16213) object-size: ( 345.22144, 162.27859)
class id: 7 upper-left: ( 236.51318, 802.92780) object-size: ( 486.17816, 269.36493)
class id: 7 upper-left: (1282.00513, 209.12936) object-size: ( 202.10974, 115.12851)
class id: 7 upper-left: ( 372.09344, 535.28412) object-size: ( 309.26434, 229.60358)
class id: 7 upper-left: ( 502.21912, 130.76361) object-size: ( 141.95667, 148.55127)
class id: 7 upper-left: (1552.48718, 262.08255) object-size: ( 273.29871, 141.04590)
class id: 7 upper-left: (1101.15466, 173.13582) object-size: ( 152.95129, 96.85536)
##############################################
############################
SUMMARY: detect
############################
[ ssd overall] loops: 1 avg: 68541 us
[ read image] loops: 1 avg: 14919 us
[ attach input] loops: 1 avg: 700 us
[ detection] loops: 1 avg: 40730 us
[ ssd pre-process] loops: 1 avg: 4020 us
[ ssd pre-process-vpp] loops: 1 avg: 3878 us
[ssd pre-process-linear_tranform] loops: 1 avg: 137 us
[ ssd inference] loops: 1 avg: 36422 us
[ ssd post-process] loops: 1 avg: 283 us
测试 FP32 infer,测试100次。
############################
SUMMARY: detect
############################
[ ssd overall] loops: 100 avg: 52223 us
[ read image] loops: 100 avg: 6036 us
[ attach input] loops: 100 avg: 646 us
[ detection] loops: 100 avg: 36320 us
[ ssd pre-process] loops: 100 avg: 1352 us
[ ssd pre-process-vpp] loops: 100 avg: 1234 us
[ssd pre-process-linear_tranform] loops: 100 avg: 114 us
[ ssd inference] loops: 100 avg: 34782 us
[ ssd post-process] loops: 100 avg: 179 us
real 0m5.746s
user 0m0.300s
sys 0m0.708s
TPU存储空间占用约170MB,TPU计算单元占用约70%。
测试 FP32 infer,测试10000次。
############################
SUMMARY: detect
############################
[ ssd overall] loops: 100 avg: 52355 us
[ read image] loops: 100 avg: 6036 us
[ attach input] loops: 100 avg: 592 us
[ detection] loops: 100 avg: 36299 us
[ ssd pre-process] loops: 100 avg: 1337 us
[ ssd pre-process-vpp] loops: 100 avg: 1213 us
[ssd pre-process-linear_tranform] loops: 100 avg: 117 us
[ ssd inference] loops: 100 avg: 34766 us
[ ssd post-process] loops: 100 avg: 186 us
real 8m40.758s
user 0m21.340s
sys 0m51.500s
TPU存储空间占用约170MB,TPU计算单元占用约70%。
int8_ssd300.bmodel
模型测试 IN8 infer,测试1次。
linaro@seeking:/data/ssd_object_demo$ time ./ssd300_cv_bmcv_bmrt.arm image ./vehicle_1.jpg int8_ssd300.bmodel 1 0
set device id:0
bmcpu init: skip cpu_user_defined
open usercpu.so, init user_cpu_init
[BMRT][load_bmodel:784] INFO : Loading bmodel from [int8_ssd300.bmodel]. Thanks for your patience...
[BMRT][load_bmodel:748] INFO : pre net num: 0, load net num: 1
Open /dev/jpu successfully, device index = 0, jpu fd = 22, vpp fd = 23
class id: 6 upper-left: ( 650.39563, 219.20303) object-size: ( 907.43347, 681.00745)
class id: 6 upper-left: (1397.98071, 454.04749) object-size: ( 493.77759, 623.05029)
class id: 6 upper-left: ( 801.93707, 43.81337) object-size: ( 484.97638, 189.64525)
class id: 7 upper-left: ( 366.49045, 511.13013) object-size: ( 300.19205, 229.80463)
class id: 7 upper-left: ( 265.79416, 786.34570) object-size: ( 475.49539, 278.35022)
class id: 7 upper-left: (1303.27466, 187.31776) object-size: ( 162.53564, 122.18419)
class id: 7 upper-left: (1529.50635, 233.78185) object-size: ( 294.20020, 172.38023)
##############################################
############################
SUMMARY: detect
############################
[ ssd overall] loops: 1 avg: 47610 us
[ read image] loops: 1 avg: 7244 us
[ attach input] loops: 1 avg: 655 us
[ detection] loops: 1 avg: 30116 us
[ ssd pre-process] loops: 1 avg: 1506 us
[ ssd pre-process-vpp] loops: 1 avg: 1349 us
[ssd pre-process-linear_tranform] loops: 1 avg: 153 us
[ ssd inference] loops: 1 avg: 28349 us
[ ssd post-process] loops: 1 avg: 255 us
real 0m0.224s
user 0m0.088s
sys 0m0.092s
测试 IN8 infer,测试100次
############################
SUMMARY: detect
############################
[ ssd overall] loops: 100 avg: 45492 us
[ read image] loops: 100 avg: 5941 us
[ attach input] loops: 100 avg: 598 us
[ detection] loops: 100 avg: 29812 us
[ ssd pre-process] loops: 100 avg: 1359 us
[ ssd pre-process-vpp] loops: 100 avg: 1238 us
[ssd pre-process-linear_tranform] loops: 100 avg: 116 us
[ ssd inference] loops: 100 avg: 28301 us
[ ssd post-process] loops: 100 avg: 146 us
real 0m4.729s
user 0m0.288s
sys 0m0.616s
TPU存储空间占用约47MB,TPU计算单元占用约60%。
测试 IN8 infer,测试10000次
############################
SUMMARY: detect
############################
[ ssd overall] loops: 100 avg: 45465 us
[ read image] loops: 100 avg: 6047 us
[ attach input] loops: 100 avg: 590 us
[ detection] loops: 100 avg: 29793 us
[ ssd pre-process] loops: 100 avg: 1331 us
[ ssd pre-process-vpp] loops: 100 avg: 1206 us
[ssd pre-process-linear_tranform] loops: 100 avg: 118 us
[ ssd inference] loops: 100 avg: 28305 us
[ ssd post-process] loops: 100 avg: 147 us
real 7m38.763s
user 0m19.536s
sys 0m52.036s
TPU存储空间占用约47MB,TPU计算单元占用约60%。
out-batch-fp32-t_0_dev_0_vehicle_1.jpg