iduta / pyconv

Pyramidal Convolution: Rethinking Convolutional Neural Networks for Visual Recognition (https://arxiv.org/pdf/2006.11538.pdf)
MIT License
328 stars 53 forks source link

PyConv2d #5

Closed shuaizzZ closed 4 years ago

shuaizzZ commented 4 years ago

Why not use PyConv2d module, it seems that using nn.ModuleList will take up more GPU memory?

iduta commented 4 years ago

PyConv2d is for the general case, and it looks that nn.ModuleList is the safe way to go for ensuring that the modules it contains are properly registered, otherwise, if using a regular list, it can create problems for the optimizer. This was previously discussed in several posts, for instance here. Alternatively, if you don't want to use nn.ModuleList, you can create directly a custom PyConv2d, for instance, see our PyConv2, PyConv3 or PyConv4 (if needed, for flexibility, you can add there another argument for the number of output feature maps for each level of PyConv).