ben-louis / fisherpruning-pytorch Goto Github PK
View Code? Open in Web Editor NEWAn implementation of <Group Fisher Pruning for Practical Network Compression> based on pytorch and mmcv
An implementation of <Group Fisher Pruning for Practical Network Compression> based on pytorch and mmcv
感谢您复现这个code,我想请问下该方法是否支持二阶段的检测方法呢,比如cascade_mask_rcnn之类的。多谢!
您好,仓库里没有baseline训练文件,请问您是怎么对照剪枝效果呢?baseline是这样子训练吗?
base = [
'../base/models/resnet50.py', '../base/datasets/cifar10_bs16.py',
'../base/schedules/cifar10_bs128.py', '../base/default_runtime.py'
]
optimizer = dict(lr=0.004)
work_dir = "work_dirs/resnet50-baselilne"
load_from = "https://download.openmmlab.com/mmclassification/v0/resnet/resnet50_8xb32_in1k_20210831-ea4938fc.pth"
Hello! I saw you tested the code in torch1.8.
I tried it on RTX 3090 with torch==1.8, cudatoolkit==11.1, mmcv-full with serveral different version installed with pip, mmdet==2.17 When running on COCO in pruning stage, it always occurs
File "tools/prune_train.py", line 195, in <module>
main()
File "tools/prune_train.py", line 191, in main
meta=meta)
File "/home/dell/programme/FisherPruning-Pytorch/mmdet/apis/train.py", line 174, in train_detector
runner.run(data_loaders, cfg.workflow)
File "/home/dell/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 127, in run
epoch_runner(data_loaders[i], **kwargs)
File "/home/dell/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py", line 51, in train
self.call_hook('after_train_iter')
File "/home/dell/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/base_runner.py", line 307, in call_hook
getattr(hook, fn_name)(self)
File "/home/dell/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/mmcv/runner/hooks/optimizer.py", line 36, in after_train_iter
runner.outputs['loss'].backward()
File "/home/dell/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/tensor.py", line 245, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "/home/dell/anaconda3/envs/open-mmlab/lib/python3.7/site-packages/torch/autograd/__init__.py", line 147, in backward
allow_unreachable=True, accumulate_grad=True) # allow_unreachable flag
File "/home/dell/programme/FisherPruning-Pytorch/tools/fisher_pruning.py", line 385, in compute_fisher_backward_hook
grads = feature * grad_feature
RuntimeError: The size of tensor a (256) must match the size of tensor b (36) at non-singleton dimension 1
But when I tried on TITAN RTX with torch==1.3 as the author of this paper suggests, this error disappears.
Have you encountered this problem? Thanks!
Thank you very much for your optimization. I tried to reproduce the pruning effect on classification. But it reported an error. I suspect it is a torch version problem, but after switching to the same version as your experiment, still have this problem. Can you give suggestions?
sys.platform: linux
Python: 3.7.11 (default, Jul 27 2021, 14:32:16) [GCC 7.5.0]
CUDA available: True
GPU 0,1,2,3,4,5,6,7: GeForce RTX 3090
CUDA_HOME: /usr/local/cuda-11.1
NVCC: Build cuda_11.1.TC455_06.29069683_0
GCC: gcc (GCC) 5.4.0
PyTorch: 1.8.0+cu111
PyTorch compiling details: PyTorch built with:
TorchVision: 0.9.0+cu111
OpenCV: 4.5.3
MMCV: 1.3.17
MMCV Compiler: GCC 5.4
MMCV CUDA Compiler: 11.1
MMClassification: 0.15.0+729c6c1
it only trained on Linux os? Windows os is ok?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.