We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is the code:
def __init__(self, num_classes, block=BasicBlock, num_blocks=[5, 5, 5]): super(ResNet32, self).__init__() self.in_planes = 16 self.conv1 = MetaConv2d(3, 16, kernel_size=3, stride=1, padding=1, bias=False) self.bn1 = MetaBatchNorm2d(16) self.layer1 = self._make_layer(block, 16, num_blocks[0], stride=1) self.layer2 = self._make_layer(block, 32, num_blocks[1], stride=2) self.layer3 = self._make_layer(block, 64, num_blocks[2], stride=2) self.linear = MetaLinear(64, num_classes) self.apply(_weights_init) def _make_layer(self, block, planes, num_blocks, stride): strides = [stride] + [1]*(num_blocks-1) layers = [] for stride in strides: layers.append(block(self.in_planes, planes, stride)) self.in_planes = planes * block.expansion return nn.Sequential(*layers) def forward(self, x): out = F.relu(self.bn1(self.conv1(x))) out = self.layer1(out) out = self.layer2(out) out = self.layer3(out) out = F.avg_pool2d(out, out.size()[3]) out = out.view(out.size(0), -1) out = self.linear(out) return out model = ResNet32()``` When I use `for name, p in list(model.named_params()):` it returns 'NoneType' object has no attribute '_parameters' Thank you!
The text was updated successfully, but these errors were encountered:
model.named_params(model)
Sorry, something went wrong.
No branches or pull requests
Here is the code:
The text was updated successfully, but these errors were encountered: