def __init__(self, class_num, insize, class_weight=None, caffemodel_path=None):
    assert ((insize % 32) == 0), "'insize' should be divisible by 32."
    super(ResNet50, self).__init__()
    with self.init_scope():
        self.conv1 = L.Convolution2D(3, 64, 7, 2, 3, initialW=initializers.HeNormal())
        self.bn1 = L.BatchNormalization(64)
        self.res2 = Block(3, 64, 64, 256, 1)
        self.res3 = Block(4, 256, 128, 512)
        self.res4 = Block(6, 512, 256, 1024)
        self.res5 = Block(3, 1024, 512, 2048)
        self.fc = L.Linear(2048, class_num)
    if (caffemodel_path is not None):
        self._load_pretrained_weights(caffemodel_path)
    self._class_num = class_num
    self._insize = insize
    self._class_weight = class_weight
def __init__(self, class_num, insize, class_weight=None, caffemodel_path=None):
    assert ((insize % 32) == 0), "'insize' should be divisible by 32."
    super(ResNet50, self).__init__()
    with self.init_scope():
        self.conv1 = L.Convolution2D(3, 64, 7, 2, 3, initialW=initializers.HeNormal())
        self.bn1 = L.BatchNormalization(64)
        self.res2 = Block(3, 64, 64, 256, 1)
        self.res3 = Block(4, 256, 128, 512)
        self.res4 = Block(6, 512, 256, 1024)
        self.res5 = Block(3, 1024, 512, 2048)
        self.fc = L.Linear(2048, class_num)
    if (caffemodel_path is not None):
        self._load_pretrained_weights(caffemodel_path)
    self._class_num = class_num
    self._insize = insize
    self._class_weight = class_weight