Resnet 50 # -*- coding: utf-8 -*- import torch.nn as nn import math import torch.utils.model_zoo as model_zoo class residual_block(nn.Module): expansion = 4 def __init__(self, inplanes, planes, stride=1, downsample = None): super(residual_block, self).__init__() self.conv1 = nn.Conv2d(inplanes, planes, bias=False, kernel_size=1) self.bn1 = nn.BatchNorm2d(planes) self.conv2 = nn.Conv2d(planes, planes, stride = stride, kernel_size=3 , padding=1, bias = False) self.bn2 = nn.BatchNorm2d(planes) self.conv3 = nn.Conv2d(planes, planes*4, kernel_size=1,bias=False) self.bn3 = nn.BatchNorm2d(planes * 4)