thomasverelst / dynconv Goto Github PK
View Code? Open in Web Editor NEWCode for Dynamic Convolutions: Exploiting Spatial Sparsity for Faster Inference (CVPR2020)
Home Page: https://arxiv.org/abs/1912.03203
Code for Dynamic Convolutions: Exploiting Spatial Sparsity for Faster Inference (CVPR2020)
Home Page: https://arxiv.org/abs/1912.03203
Hi,
Thanks for your great work!
I have some questions about the mask usage in your convolution operation. I'm wondering what is the meaning to assign conv_module.__mask__
with mask
. I checked that the conv_module(x)
function does not consider the conv_module.__mask__
property when operating.
dynconv/classification/dynconv/layers.py
Lines 14 to 18 in 19e4c58
Therefore, I can't get how the masks are applied in network forward propagation, such as the basicblock in
dynconv/classification/models/resnet_util.py
Lines 66 to 70 in 19e4c58
It seems that only the mask in dynconv.apply_mask(x, mask)
works.
Congrats, nice work! I have two questions out of curiosity:
Forward pass: Why did you choose to sample from the Bernoulli distribution instead of the Gumbel-softmax? To my knowledge, sampling from the Bernoulli distribution introduces a bias in the gradient estimation which could make optimization trickier. I understand that you would not be able to use sparse convolutions in the training but I wonder if there is another reason.
Have you tried annealing the temperature parameter to less than 1?
Thank you for your work; it has been very inspiring. However, I encountered some issues when trying to replicate the experimental results. Specifically, I am having trouble with preprocessing the MPII dataset. Following the format in the README does not seem to work, and converting it to COCO format also leads to problems. Could you please provide guidance on how to preprocess the MPII dataset correctly so that I can successfully run the test code in the pose project?
Hello,
Thank you for your effort to make your great work open source. I just wanted to ask you if you have a version of your code compatible with google colab to be able to run it without having GPU?
Thanks for your work.
What type of license this project has? MIT, GNU or anything else?
This code is buggy and the environment configuration is fine, the server is 4090,24 gigabytes of video memory。
model = net_module(sparse=args.budget >= 0, pretrained=args.pretrained).to(device=device)
Excellent work !!!
Recently I have studied your paper and code , which is very enlightening to me. I sincerely think that your work is of great significence for us to study the dynamic convolutions. Thank you for your excellent work very much!
By the way, could you please tell me the time when the code of "Classification with efficient sparse MobileNetV2" will be published? I think it would be also a wonderful code !!!
Thank you very much!
Insightful work!!!
During the study of your paper, I have some questions (My English is not very good, and I am not aggressive, just some confusion):
if gumbel_noise:
eps = self.eps
U1, U2 = torch.rand_like(x), torch.rand_like(x)
g1, g2 = -torch.log(-torch.log(U1 + eps)+eps), - \
torch.log(-torch.log(U2 + eps)+eps)
x = x + g1 - g2
soft = torch.sigmoid(x / gumbel_temp)
hard = ((soft >= 0.5).float() - soft).detach() + soft
However, the paper said, "Note that this formulation has no logarithms or exponentials in the forward pass, typically expensive computations on hardware platforms"
So in the code, why not just use soft >= 0, and no sigmoid operation.
Thanks for your kind help!
File "main_cifar.py", line 224, in validate
viz.plot_ponder_cost(meta['masks'])
File "/Data2/xyz/dynconv-master/classification/utils/viz.py", line 26, in plot_ponder_cost
ponder_cost = ponder_cost_map(masks)
File "/Data2/xyz/dynconv-master/classification/dynconv/utils.py", line 23, in ponder_cost_map
return out.squeeze(0).cpu().numpy()
AttributeError: 'NoneType' object has no attribute 'squeeze'
Why this is showing while plotting the ponder_cost_map?
Hello, this is brilliant work, I want to use the binary gumbel-softmax for my work. But there are some problems.
I used the soft mask for the first layer only (just apply the generated mask to the features after the first layer),and I found a strange phenomenon。The gumbel noise seemed to influence the training process too much. I plotted the sparsity loss only, and I found I usually couldn't obtain the sparsity target I set. Is this process right?
temp=5.0
temp=1.0
Thanks for your amazing work.
I want to apply your method to a standard convolution instead of a depthwise one.
Does your cuda code support standard convolutions?
Wonderful job!I studied your paper and code these days, which is very enlightening to me.
I have a question about the code to calculate the soft-mask by soft = self.maskconv(x). I'm not quite sure what the reason for choosing this (conv+fc) network to calculate the soft-mask. Thank you for your kind help.
Thanks for your inspiring work on dynamic convolution. I am interested in this exciting work and try to test the efficiency of dynconv. I run the test code for pose estimation and met a exception: No such file or directory: '$mpii_root/annot/valid.json'.
I wonder how can I get this file.
BTW, when I set the stride = 2 for conv3x3_dw. I often crashed with 'THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1565272279342/work/aten/src/THC/THCCachingHostAllocator.cpp line=296 error=77 : an illegal memory access was encountered'. Could you help me debug those issues? Thanks in advance.
Pengyu Zhang.
Hi. Thanks for your work. I am currently running the pose demo, but I failed to build the lib folder, which shows
"make: *** No targets specified and no makefile found. Stop".
What should I do for it?
Thanks for your awesome work! Is there any idea how multi-gpu training is supported? Because you know training ResNet-101 on ImageNet with a single GPU is unacceptably slow.
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.