Comments (2)
解决了,在剪枝的时候判断剪枝的mask中1的个数是否为1,若为1则逐渐减小thresh以保证mask中1的个数大于1,相当于剩余通道不为1了,以下为代码:
prune_utils.py中
def obtain_bn_mask(bn_module, thre):
thre = thre.cuda()
mask = bn_module.weight.data.abs().ge(thre).float()
ones = (mask == 1.).sum().sum()
while ones<=1:
thre -= 0.005
mask = bn_module.weight.data.abs().ge(thre).float()
ones = (mask == 1.).sum().sum()
return mask
from yolov5prune.
你好,我也出现这个问题,请问你解决了吗
from yolov5prune.
Related Issues (20)
- step后权值没有更新 HOT 1
- 在进行稀疏化的时候遇到报错 HOT 2
- TypeError: on_fit_epoch_end() missing 1 required positional argument: 'fi'
- 6.0版本稀疏训练train_sparity.py 报错TypeError: on_fit_epoch_end() takes 5 positional arguments but 6 were given HOT 2
- 我想请教下稀疏训练的稀疏效果一直不好是怎么回事,我甚至把sr开到了10 HOT 2
- prune.py脚本运行报错 too many indices for tensor demension 3 HOT 1
- 计算量 HOT 1
- RuntimeError: mat1 and mat2 shapes cannot be multiplied HOT 1
- 训练自己的算法
- 使用train_sparsity.py出现的错误- HOT 1
- 已经充分稀疏的情况下,剪枝率只能设置到0.1
- 关于train.py训练后tensorboard中没有bn_weights/hist直方图 HOT 1
- v7.0版本能用吗? HOT 4
- 运行预测脚本的时候报错了 显示yolo脚本没有DetectionModel这个属性
- 更换主干网络再经行稀疏化训练后,值变成了nan
- tensorboard中的histogram图表中的数据如何导出呢
- IndexError: too many indices for tensor of dimension 3
- 稀疏因子最高只能设为0.1,再高一点剪枝最大比例反而会降低是怎么回事
- 剪枝出现Scanning 'E:\task\experiment\dataset\BITVehicle\BITVehicle\val.cache' images and labels... 0 found, 985 missing, 0 empty, 0 corrupted HOT 1
- 博主麻烦看看这个问题 进行prune.py 出现KeyError: 'model.0.bn'问题
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 yolov5prune.