Code Monkey home page Code Monkey logo

dynamic-convolution-pytorch's People

Contributors

kaijieshi7 avatar wgharbieh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dynamic-convolution-pytorch's Issues

how to use 1D dynamic convolution

I am really interested in a fantastic Dynamic Convolution and I intend to use it in my research but I can not figure out how to use it.
I can not determine the relation between in_planes , out_planes, groups, and other parameters and how it affects the performance.
hope you will provide more clarification about the code and parameters' relationship to each other and to the input.

替换mobilenetv2的分组卷积报错

当替换分组卷积时,weight的维度和group的维度不对应。
RuntimeError: Given groups=1024, expected weight to be at least 1024 at dimension 0, but got weight of size [32, 32, 3, 3] instead
aggregate_weight = torch.mm(softmax_attention, weight).view(-1, self.in_planes, self.kernel_size, self.kernel_size)
这一行应改成下面这样
aggregate_weight = torch.mm(softmax_attention, weight).view(-1, self.in_planes//self.groups, self.kernel_size, self.kernel_size)

无法训练

大佬你好!
for idx_batch, (inputs, targets) in enumerate(trainloader):
这句for循环不知道为什么不执行

RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...)

My image size is 112,112 and I got the below error. Any solution?

Line number
ConvLayers/dynamic_conv.py", line 176, in forward

_x = x.view(1, -1, height, width)# 变化成一个维度进行组卷积
RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...)_

预训练权重不能加载

你好,请问我将动态卷积加入resnet,预训练模型不匹配,应该如何加载预训练权重的问题呀

感谢复现

请问您有自己实验了吗?速度和精度能达到论文那个水平吗

A Question in Batch Size and torch.Tensor.expand

Thank you for providing this reproduction!

I have a question on the grouped convolution: in this line you use the grouped convolution to solve the mini-batch training problem.

Could we use the torch.Tensor.expand to replace the grouped convolution, like:

weight_prime = weight.expand(K, weight.shape[0], weight.shape[1], weight.shape[2], weight.shape[3])
weight = torch.mm(softmax_attention, weight_prime).view(-1, x.shape[1], self.kernel_size, self.kernel_size)

In this way, we might aggregate the attention weight and the convolution weight together. However, this may cause another problem. If batch size ($\mathcal{B}$) is larger than 1, the attention weight would be a matrix with $\mathcal{B} \times K$, I think we can use torch.mean(attention_weight, dim=0) or torch.max(attention_weight, dim=0) since they are calculated within the batch, in which the range is very close.

I am not sure whether this calculation is equivalent to the line :)

关于Temperature的问题想向您请教,期盼回复

作者您好,感谢您对论文的复现!

程序中关于温度问题我还不太明白,期待您的回复:
1.不同的温度值对于模型的训练有什么影响呢?在程序的哪个部分可以体现呢?
2.如果想要使训练温度保持恒定,即不使用temperature annealing,在程序中需要做哪些改动呢?

再次表示感谢!祝您一切顺利!!

No accuracy boost with default settings

I don't observe any accuracy boost for dy_resnet18 compared to raw_resnet18 model on CIFAR10 and CIFAR100 datasets.
I used default hyper-parameters for the training and observed.
CIFAR10: dy 86.01%, raw 87.75%
CIFAR100: dy 54.59%, raw 56.52%.
All the experiments were bellow my expectations (>90% for CIFAR10, >70% for CIFAR100).
How to take advantage of dynamic convs?

想请教以下用3D动态卷积的时候报错问题

很感谢你的分享,但是我在调试过程中发现当输入为(128,1,20,30,30)这个tensor的通道为1时,代码会报错,
File "D:\anaconda3\envs\py38\lib\site-packages\torch\nn\modules\conv.py", line 557, in init
super(Conv3d, self).init(
File "D:\anaconda3\envs\py38\lib\site-packages\torch\nn\modules\conv.py", line 83, in init
self.reset_parameters()
File "D:\anaconda3\envs\py38\lib\site-packages\torch\nn\modules\conv.py", line 86, in reset_parameters
init.kaiming_uniform_(self.weight, a=math.sqrt(5))
File "D:\anaconda3\envs\py38\lib\site-packages\torch\nn\init.py", line 381, in kaiming_uniform_
fan = _calculate_correct_fan(tensor, mode)
File "D:\anaconda3\envs\py38\lib\site-packages\torch\nn\init.py", line 350, in _calculate_correct_fan
fan_in, fan_out = _calculate_fan_in_and_fan_out(tensor)
File "D:\anaconda3\envs\py38\lib\site-packages\torch\nn\init.py", line 282, in _calculate_fan_in_and_fan_out
receptive_field_size = tensor[0][0].numel()
IndexError: index 0 is out of bounds for dimension 0 with size 0

网络训练

在打印的网络中并没有看到动态生成的weight和bias,这样是可以训练的嘛?(ps:此前在训练层注意力中,也用到了beta=nn.parameter,但是定义的参数beta值一直都没有改动!!!)。能问下您的pytorch版本嘛?

请问如何正确运行_错误是model未定义

您好,感谢您的代码!我在运行前将cifar10放入新建的data文件夹中,然后运行main时解压成了如图文件。之后就产生了没有model定义的报错,如图所示。请问应该如何正确运行呢?如果能解答,万分感谢!!
000
001
002

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.