CNN量化-嵌入式移植

参考文章:

深度学习框架之间的模型相互转换

TensorFlow Lite初次尝试

https://www.jianshu.com/p/62d5184e581a

Pytorch 和Tensorflow之间的相互转化

https://www.jianshu.com/p/633c7d1c5cff

一行代码切换TensorFlow与PyTorch,模型训练也能用俩框架

https://baijiahao.baidu.com/s?id=1639028277077254350&wfr=spider&for=pc

从PyTorch到Mxnet ,对比7大Python深度学习框架

http://www.360doc.com/content/19/0309/14/43284313_820288744.shtml

mxnet模型可视化

https://blog.csdn.net/helloworld_fly/article/details/107891833

mxnet网络结构可视化——有用!

https://blog.csdn.net/qq_22764813/article/details/96271142

深度学习模型转换之Mxnet转ONNX - GrantWong - 博客园

https://www.cnblogs.com/wanggangtao/p/13180406.html

网络计算量分析

CNN模型复杂度(FLOPS、MAC)、参数量与运行速度(较好,详细,暂未看)

https://blog.csdn.net/weixin_39833897/article/details/105807172

【深度学习-CNN】CNN中的参数与计算量(较好,详细)

https://blog.csdn.net/dzkd1768/article/details/72763659

从TensorFlow Lite源码入门CNN量化

https://zhuanlan.zhihu.com/p/42811261

浮点峰值那些事儿

https://zhuanlan.zhihu.com/p/28226956

深度学习CPU,GPU,NPU,TPU以及其计算能力单位

https://blog.csdn.net/u010451780/article/details/104720082

CNN 模型所需的计算力(flops)和参数(parameters)数量是怎么计算的

https://www.zhihu.com/question/65305385

Flops计算方式

https://blog.csdn.net/u011808673/article/details/88838717

rk3399pro NPU 算力测试

https://blog.csdn.net/bh_binghu/article/details/90379602

PyTorch转Onnx转TensorRT、NCNN、ARMNN。。。

python3环境下pytorch模型转onnx部署tensorRT(实践经验,较简单)

https://blog.csdn.net/u012114438/article/details/104558119/

从PyTorch到ONNX再到TensorRT(实践经验,较简单,有代码)

https://blog.csdn.net/qq_29159273/article/details/99851136

深度学习模型移植pytorch->onnx->ncnn->android(实践经验,完整,有代码,好)

https://blog.csdn.net/hmzjwhmzjw/article/details/94027816

使用ONNX部署深度学习和传统机器学习模型(未实践,在PC端未使用onnx模型把算法跑起来)

https://www.jianshu.com/p/c1e0efe6482f

onnx-simplifier、netron优化、可视化工具,可用pip install onnx-simplifier,pip install netron

https://github.com/daquexian/onnx-simplifier

https://github.com/lutzroeder/netron

轻量好用的神经网络模型可视化工具netron

https://blog.csdn.net/qqqzmy/article/details/86060131

tensorrt_demos实操代码

https://github.com/jkjung-avt/tensorrt_demos

https://github.com/onnx/onnx-tensorrt

onnx、pytorch中文教程

https://www.cntofu.com/book/169/docs/1.0/ONNXLive.md

https://pytorch.apachecn.org/docs/1.2/onnx.html

Pytorch2onnx实战(入门级)

https://blog.csdn.net/Creama_/article/details/105033824

Pytorch2onnx2Tensorflow的环境准备win10(入门级)

https://blog.csdn.net/Creama_/article/details/105024840

onnx部署方法(不实用)

ai-deployment

https://github.com/aipredict/ai-deployment

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator

https://github.com/microsoft/onnxruntime

ONNX_Runtime_Perf_Tuning.md

https://github.com/microsoft/onnxruntime/blob/master/docs/ONNX_Runtime_Perf_Tuning.md

TensorRT介绍(针对NVIDIA的部署优化库)

TensorRT 介绍(详细+实战)

https://www.cnblogs.com/qccz123456/p/11767858.html

[深度学习]TensorRT为什么能让模型跑快快(介绍性)

https://zhuanlan.zhihu.com/p/64933639

NVIDIA Deep Learning TensorRT Documentation(官方教程)

https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html

NCNN、TNN与MNN介绍

Ncnn使用详解(1)——PC端

https://blog.csdn.net/qq_36982160/article/details/79929869

Ncnn使用详解(2)——Android端

https://blog.csdn.net/qq_36982160/article/details/79931741

腾讯ncnn框架和阿里巴巴MNN框架(含使用教程链接)--工程化的曙光

https://blog.csdn.net/weixin_42263508/article/details/89886182

框架源码下载及介绍(Tencent、alibaba两个账户下有不少有用的资料)

https://github.com/Tencent/ncnn

https://github.com/alibaba/MNN

https://github.com/Tencent/TNN

https://github.com/XiaoMi/mace

深度学习框架大PK:TNN决战MNN,ncnn依旧经典

https://blog.csdn.net/weixin_42137700/article/details/107137353

关于端侧推理的一些框架

https://blog.csdn.net/lixuejun2008/article/details/103897626

开源框架-腾讯优图TNN-移动端高性能、轻量级推理框架

https://blog.csdn.net/yangzijiangtou/article/details/106722904

ncnn编译和使用

protobuf版本冲突以及解决办法

https://blog.csdn.net/qq_41953012/article/details/106792245

use-ncnn-with-alexnet.zh(官方教程)

https://github.com/Tencent/ncnn/wiki/use-ncnn-with-alexnet.zh

ncnn模型加载的三种方式

https://blog.csdn.net/Enchanted_ZhouH/article/details/106063552

Caffe模型转NCNN后生成param与bin文件及相关NCNN源码解析(分析ncnn模型与pytorch模型之间的误差用)

https://blog.csdn.net/yufeilongyuan/article/details/106322613

自上而下解读ncnn系列(1):加载param模型和bin文件前向传播(模型载入和网络重构,代码解析,分析ncnn源码用)

https://blog.csdn.net/hanzy88/article/details/100156252

FAQ-ncnn-produce-wrong-result(非常实用,必备)

https://github.com/Tencent/ncnn/wiki/FAQ-ncnn-produce-wrong-result

caffeModels--models-caffes-大全

https://www.cnblogs.com/leoking01/p/7123154.html

FPGA移植CNN算法

CNN算法FPGA移植

https://www.cnblogs.com/sepeng/category/1178632.html

 

ncnn PC端和交叉编译

myBuildx86.sh

#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status.
BuildDir=build_x86_64
if [ ! -d "$BuildDir" ]; then
  # Take action if $BuildDir doesn‘t exists. 
  echo "create ${BuildDir}..."
  mkdir -p ${BuildDir}
fi
cd ${BuildDir}

export VULKAN_SDK=/home/robert/DeepLearning/NXP-imx8QX/CompileResult/vulkansdk-linux-x86_64-1.1.114.0/x86_64

cmake -DNCNN_VULKAN=ON -DCMAKE_INSTALL_PREFIX=/home/robert/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/ncnn_x86_64-install ..

make -j$(nproc) install

# cd build_x86_64/examples/
# ./squeezenet Dog.jpg

myBuildARM.sh

#!/bin/bash
set -e # Exit immediately if a command exits with a non-zero status.
BuildDir=build_arm_x64_proto
if [ ! -d "$BuildDir" ]; then
  # Take action if $BuildDir doesn‘t exists. 
  echo "create ${BuildDir}..."
  mkdir -p ${BuildDir}
fi
cd ${BuildDir}

echo "building ncnn_arm_x64"
export LD_LIBRARY_PATH=/opt/fsl-imx-xwayland/4.14-sumo/sysroots/aarch64-poky-linux/usr/lib
source /opt/fsl-imx-xwayland/4.14-sumo/environment-setup-aarch64-poky-linux
export PATH=$PATH:/home/robert/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/google/arm64_pb_install/bin/
export PKG_CONFIG_PATH=/home/robert/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/google/arm64_pb_install/lib/pkgconfig/

cmake .. \
    -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake \
    -DCMAKE_INSTALL_PREFIX=/home/robert/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/ncnn_arm_x64-install-proto \
    -DPROTOBUF_ROOT=$HOME/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/google/arm64_pb_install \
    -DPROTOBUF_INCLUDE_DIRS=$HOME/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/google/arm64_pb_install/include \
    -DPROTOBUF_LIBRARY_DEBUG=$HOME/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/google/arm64_pb_install/lib/libprotobuf.so.15.0.1 \
    -DPROTOBUF_LIBRARY_RELEASE=$HOME/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/google/arm64_pb_install/lib/libprotobuf.so.15.0.1

make -j$(nproc) install

# cd build_x86_64/examples/
# ./squeezenet Dog.jpg

toolchain.cmake

# this is required
SET(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

# specify the cross compiler
SET(CMAKE_C_COMPILER   /opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-gcc)
SET(CMAKE_CXX_COMPILER /opt/fsl-imx-xwayland/4.14-sumo/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++)

# cache flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "c flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "c++ flags")

set(Protobuf_PREFIX_PATH
   "/home/robert/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/google/x86_64_pb_install/include"
   "/home/robert/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/google/x86_64_pb_install/lib"
   "/home/robert/DeepLearning/NXP-imx8QX/CompileResult/armnn-devenv/google/x86_64_pb_install/bin"
)
list(APPEND CMAKE_PREFIX_PATH "${Protobuf_PREFIX_PATH}")

SET(CMAKE_SYSROOT /opt/fsl-imx-xwayland/4.14-sumo/sysroots/aarch64-poky-linux)

# where is the target environment 
SET(CMAKE_FIND_ROOT_PATH  /opt/fsl-imx-xwayland/4.14-sumo/sysroots/aarch64-poky-linux)

# specify the compiler flag
# SET(CMAKE_C_FLAGS  -O3 -mtune=cortex-a35 -mcpu=cortex-a35 -march=armv8-a+fp+simd+crc+crypto)
# SET(CMAKE_CXX_FLAGS  -std=c++11 -O3 -mtune=cortex-a35 -mcpu=cortex-a35 -march=armv8-a+fp+simd+crc+crypto)

set(CMAKE_C_FLAGS "-march=armv8-a")
set(CMAKE_CXX_FLAGS "-march=armv8-a")

# search for programs in the build host directories (not necessary)
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值