Comments (6)
Please make sure that you are executing with the correct commandline parameters. For --cardinality 32 --widen_factor 4 --depth 50 --base_width 4
I get:
(stage_1): Sequential(
(stage_1_bottleneck_0): ResNeXtBottleneck(
(conv_reduce): Conv2d(64, 128, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn_reduce): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv_conv): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=32, bias=False)
(bn): BatchNorm2d(128, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(conv_expand): Conv2d(128, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(bn_expand): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(shortcut): Sequential(
(shortcut_conv): Conv2d(64, 256, kernel_size=(1, 1), stride=(1, 1), bias=False)
(shortcut_bn): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
)
)
Which exactly corresponds to the paper (https://arxiv.org/pdf/1611.05431.pdf):
from resnext.pytorch.
Yes, it is right since these numbers are divided by the groups
of the convolution.
from resnext.pytorch.
oh, really thanks for answer~
but, emmmm, i also refer to another implement: https://github.com/kuangliu/pytorch-cifar/blob/master/models/resnext.py
And the numbers of conv with stride 3 is less than that stride 1, even though it is also divided into some groups. I check the network architecture by print(net)
, maybe you want compare the two implement ?
thanks again~
from resnext.pytorch.
Yes, i think when --cardinality 32 --widen_factor 4 --depth 50 --base_width 4
, it is right.
but in your train.py, --cardinality 8--widen_factor 4 --depth 29--base_width 64
, i got :
(stage_1): Sequential( (stage_1_bottleneck_0): ResNeXtBottleneck( (conv_reduce): Conv2d(64, 512, kernel_size=(1, 1), stride=(1, 1), bias=False) (bn_reduce): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (conv_conv): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), groups=8, bias=False) (bn): BatchNorm2d(512, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (conv_expand): Conv2d(512, 256, kernel_size=(1, 1), stride=(1, 1), bias=False) (bn_expand): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) (shortcut): Sequential( (shortcut_conv): Conv2d(64, 256, kernel_size=(1, 1), stride=(1, 1), bias=False) (shortcut_bn): BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True) ) )
I think it is wrong, in a bottlenect, the channel number of the middle conv should be half of that of the output conv. But under this parameter setting, it is twice.
sorry, i don't know how to change lines, but you can test by yourself.
from resnext.pytorch.
Resnext bottlenecks are a bit different, if you ask for a base width of 64 and a cardinality of 8, this is 64*8 = 512. These 512 will be divided in 8 groups of 64 channels.
Maybe I am wrong, could you execute the oiriginal torch code and compare with mine to make it sure?
from resnext.pytorch.
Running the torch code is a bit troublesome, but i think you are right.
I test a total of three implement code:
yours: https://github.com/prlz77/ResNeXt.pytorch/blob/master/models/model.py
https://github.com/kuangliu/pytorch-cifar/blob/master/models/resnext.py
https://github.com/D-X-Y/ResNeXt-DenseNet/blob/master/models/resnext.py
And your network architecture is same as the third one, but different from the second.
After i finish my work, i will check again. Really thanks for your answer~
from resnext.pytorch.
Related Issues (18)
- Questions about the performances. HOT 23
- GPU memory usage during training HOT 1
- Pretrained model link broken HOT 4
- question about the input img size HOT 8
- Sublinear speed-up with dataparallel HOT 1
- About initial learning rate HOT 2
- The structure problem
- cannot run inference mismatch sizes HOT 2
- Could you provide the ResNeXt of Caffe version ?
- RuntimeError: Error(s) in loading state_dict for CifarResNeXt: HOT 1
- Can I directly convert TensorFlow's ResNext weight to pytorch's weight and use it directly? HOT 2
- question about the dimension of the net HOT 4
- GPU memory usage HOT 1
- Question about the number of channels HOT 4
- OSError: [Errno 12] Cannot allocate memory HOT 13
- sizes do not match HOT 1
- TypeError: tensor(0, device='cuda:0') is not JSON serializable HOT 3
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 resnext.pytorch.