resnext-pytorch's People
Forkers
helq2612 fengwengg rongchangzhao gjyin zerocurve wendywlx wpfhtl nutszebra maozezhong eric-zhang1990 ife1er junedylan adolfgyf wh-forker siyuanwei zymale kinsheep lusinga crystraldo liupengkd hirokatsukataoka16 akolada ziqi-zhang yangkang779 qiuliru sunchuanxi billchenxi tqcai cookcv 525747310 liangshaohua freegliboracle wenbank hyg-sudo one86951 pikapikazhou hopstone pikaqiuweixiao time185 meid7887 zp1018 persuelx happydetective light-alex meta-ai-learner jlhou wangjihao920615 jimmyc96 bigheqiduo amazingday1 zzwei1 ma3252788 panyongqi yale1417 jjprincess gaozheng-tech modelreproduceljy chenbaibing elbert-lau miller408 hucui2022 caihaunqai mc261670164 littlesheepy sunshinewhy yellowpuppy shouhong-chen1 metehangelgi wangyh97 g393754526 jqjin123resnext-pytorch's Issues
#27 is right?(conv3x3(planes*2, planes*2, groups=num_group))
self.conv2 = conv3x3(planes2, planes2, groups=num_group), add' groups=num_group'?
RuntimeError: Expected 4-dimensional input for 4-dimensional weight 64 3 7 7 94387354416688, but got 5-dimensional input of size [6, 3, 3, 224, 224] instead
I have got titled error, i have checked for it. This error generally thrown as less dimension provided (i.e, expected 4 but provided 3), in that case, reshaping solves. However, in my case i need to decrease the dimensions. I got this, in the first line of forward
`def forward(self, x):
x = self.conv1(x)
x = self.bn1(x)
x = self.relu(x)
x = self.maxpool(x)
x = self.layer1(x)
x = self.layer2(x)
x = self.layer3(x)
x = self.layer4(x)
x = self.avgpool(x)
x = x.view(x.size(0), -1)
x = self.fc(x)
return x`
conv3x3() got an unexpected keyword argument 'groups'
an error in the resnext.py
What's is precision?
I want to know the precision of the training code? thanks.
The error reporting at nn.Linear
Hello, I use this code in version 2.7 of python, but there will be errors when running to nn.Linear
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/linear.py", line 41, in init
self.weight = Parameter(torch.Tensor(out_features, in_features))
TypeError: new() received an invalid combination of arguments - got (float, int), but expected one of: * (torch.device device)
- (torch.Storage storage)
- (Tensor other)
- (tuple of ints size, torch.device device)
didn't match because some of the arguments have invalid types: (float, int) - (object data, torch.device device)
didn't match because some of the arguments have invalid types: (float, int)
Can you give me an answer? Thanks very much!
RuntimeError: The size of tensor a (128) must match the size of tensor b (64) at non-singleton dimension 1
I used the model to transform a tensor (1,3,96,96), but it had an error shown in the title of the issue. So the code is not usable. Would you be so kind to revise it?
How to use it in Unet as encoder
Tried this way, but keep getting RuntimeError: Given input size: (4320x4x4). Calculated output size: (4320x-6x-6). Output size is too small at /opt/conda/conda-bld/pytorch_1525796793591/work/torch/lib/THCUNN/generic/SpatialAveragePooling.cu:63
Is it pretrained?
(input image 128*128 batch size 32)
class UNetResNext(nn.Module):
def init(self, encoder_depth, num_classes, num_filters=32, dropout_2d=0.2,
pretrained=False, is_deconv=False):
super().init()
self.num_classes = num_classes
self.dropout_2d = dropout_2d
if encoder_depth == 34:
self.encoder = resnext34()
bottom_channel_nr = 512
elif encoder_depth == 101:
self.encoder = resnext101()
bottom_channel_nr = 2048
elif encoder_depth == 152:
self.encoder = resnext152()
bottom_channel_nr = 2048
else:
raise NotImplementedError('only 34, 101, 152 version of Resnext are implemented')
self.pool = nn.MaxPool2d(2, 2)
self.relu = nn.ReLU(inplace=True)
self.conv1 = nn.Sequential(self.encoder.conv1,
self.encoder.bn1,
self.encoder.relu,
self.pool)
self.conv2 = self.encoder.layer1
self.conv3 = self.encoder.layer2
self.conv4 = self.encoder.layer3
self.conv5 = self.encoder.layer4
self.center = DecoderCenter(bottom_channel_nr, num_filters * 8 *2, num_filters * 8, False)
self.dec5 = DecoderBlockV2(bottom_channel_nr + num_filters * 8, num_filters * 8 * 2, num_filters * 8, is_deconv)
self.dec4 = DecoderBlockV2(bottom_channel_nr // 2 + num_filters * 8, num_filters * 8 * 2, num_filters * 8, is_deconv)
self.dec3 = DecoderBlockV2(bottom_channel_nr // 4 + num_filters * 8, num_filters * 4 * 2, num_filters * 2, is_deconv)
self.dec2 = DecoderBlockV2(bottom_channel_nr // 8 + num_filters * 2, num_filters * 2 * 2, num_filters * 2 * 2,
is_deconv)
self.dec1 = DecoderBlockV2(num_filters * 2 * 2, num_filters * 2 * 2, num_filters, is_deconv)
self.dec0 = ConvRelu(num_filters, num_filters)
self.final = nn.Conv2d(num_filters, num_classes, kernel_size=1)
def forward(self, x):
conv1 = self.conv1(x)
conv2 = self.conv2(conv1)
conv3 = self.conv3(conv2)
conv4 = self.conv4(conv3)
conv5 = self.conv5(conv4)
#pool = self.pool(conv5) # deleted pooling
#center = self.center(pool)
center = self.center(conv5)
dec5 = self.dec5(torch.cat([center, conv5], 1))
dec4 = self.dec4(torch.cat([dec5, conv4], 1))
dec3 = self.dec3(torch.cat([dec4, conv3], 1))
dec2 = self.dec2(torch.cat([dec3, conv2], 1))
dec1 = self.dec1(dec2)
dec0 = self.dec0(dec1)
return self.final(F.dropout2d(dec0, p=self.dropout_2d))
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.