Comments (5)
yolov8 激活层使用 relu / leakyrelu 会变快些,swish 无法量化,退回fp16计算导致更大的 overhead
from ncnn.
版本:ncnn-20240410
from ncnn.
ReLU(x)=max(0,x)
LeakyReLU(x)=max(αx,x)
其中,x 是激活函数的输入,α 是一个小的正常数,通常很小(例如 0.01)。这个函数的特点是当 x 为负时,它不会直接输出零,而是输出一个很小的正比例的值 αx。这样,即使在输入为负的情况下,梯度也不会完全消失,从而帮助维持和传递一些有用的梯度信息。
Swish函数 f(x)=x⋅σ(βx)
其中,x 是输入,σ 是Sigmoid函数,而 β 是一个可训练的参数或者固定的常数。在最初的论文中,β 被设置为1或者作为一个可学习的参数。在多个基准测试中,Swish展示了与ReLU相比在深度学习模型中的性能优势。尤其是在深层网络和复杂任务中,Swish往往能够提供更好的准确率和收敛速度。
对于使用 ReLU 和 Leaky ReLU 激活函数的模型,INT8 量化是一个有效的方法来减少模型的大小和提高推理速度,同时保持可接受的精度损失。
Swish激活函数的Sigmoid函数和乘法操作都可能在低精度下引入额外的误差。
from ncnn.
通过配置改激活层,需重新训练
Change activation function of YOLOv8
from ncnn.
激活层使用 leakyrelu ,重新训练
在2并发时,fp16平均耗时100ms,int8 (opt.use_int8_inference = true) 平均耗时125ms。
测试下来,鲲鹏920环境 int8量化对yolov8没效果,有副作用。
from ncnn.
Related Issues (20)
- benchmark测试占用率低
- 手动创建的net,推理慢了很多
- yolov8n模型在鲲鹏ARM机器的检测结果和pytorch结果不一样 HOT 6
- 我有3个GPU,但get_gpu_count()=1 HOT 8
- pnnx和ncnn输出不一致
- I convert onnx to ncnn successfully, but all my inference is all nan. Eg, the output of net.extract() is all nan. HOT 15
- 在对mtcnn模型第二层进行./ncnn2table过程中出现了段错误
- Bad performance for int8 inference on XuanTie 906 (RISC-V) HOT 1
- intrinsic code 没有体现算法的原本的设计,是否有计划升级intrinsic code,并设置vset为ta mu
- Can simplestl use in RTOS ?
- [ncnn-android-yolov8] How to handle real-time detect when the view set orientation to "landscape" ? HOT 1
- pnnx能正常转换模型,模型输出与onnx模型输出不一致 HOT 4
- EfficientPhys onnx转ncnn模型转换报错 HOT 3
- 用自己的yolov8模型 转成ncnn 在windows下部署后,接口也对上了,但是结果却出不来,不尽人意
- 是否能够单独使用矩阵乘法的API? HOT 1
- 转换模型报错,如何定位
- how do I get the fossilize file .foz out of the vulkan driver? HOT 2
- 龙芯教育派2k1000中运行报错浮点数例外
- a minor issue in prebuild ncnn-android libs
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ncnn.