In [1]:
%reload_ext autoreload
%autoreload 2
%matplotlib inline

1.


In [7]:
from fastai.conv_learner import *
from fastai.models import darknet
from pathlib import Path

In [8]:
PATH = Path('data/imagenet')
PATH_TRAIN = PATH/'train'

In [5]:
# sz = 256
# bs = 32
# darknet53 = darknet.darknet_53()
# tfms = tfms_from_model(darknet53, sz)
# model_data = ImageClassifierData.from_paths(PATH, bs=bs, tfms=tfms, val_name='train')
# learner = ConvLearner.from_model_data(darknet53, model_data)

In [9]:
learner.crit


Out[9]:
<function torch.nn.functional.nll_loss(input, target, weight=None, size_average=True, ignore_index=-100, reduce=True)>

In [12]:
model_data


Out[12]:
<fastai.dataset.ImageClassifierData at 0x7ff722707518>

In [13]:
learner.crit


Out[13]:
<function torch.nn.functional.nll_loss(input, target, weight=None, size_average=True, ignore_index=-100, reduce=True)>

In [14]:
learner.crit = F.cross_entropy

In [15]:
learner.crit


Out[15]:
<function torch.nn.functional.cross_entropy(input, target, weight=None, size_average=True, ignore_index=-100, reduce=True)>

2.

Checking behavior of .pretrained in fastai/conv_learner.py. Looking at number of FC layers at the end of a stock PyTorch model, compared to loading through FastAI:


In [9]:
from torchvision.models import resnet18

In [10]:
resnet18


Out[10]:
<function torchvision.models.resnet.resnet18(pretrained=False, **kwargs)>

In [11]:
resnet18 = resnet18()

In [3]:
# resnet18

1 linear layer at the end.


In [18]:
from fastai.conv_learner import *

In [19]:
resnet18


Out[19]:
<function torchvision.models.resnet.resnet18(pretrained=False, **kwargs)>

What fastai originally imports is the resnet18 constructor function from torchvision.models.resnet. Good to know.


In [23]:
learner = ConvLearner.from_model_data(resnet18(), model_data)

In [2]:
# learner

In [20]:
from pathlib import Path
PATH = Path('data/cifar10')

In [21]:
sz = 32
bs = 64
tfms = tfms_from_model(resnet18, sz)
model_data = ImageClassifierData.from_paths(PATH, bs, tfms=tfms, val_name='test')

In [10]:
learner = ConvLearner.pretrained(resnet18, model_data)


Downloading: "https://download.pytorch.org/models/resnet18-5c106cde.pth" to /home/ubuntu/.torch/models/resnet18-5c106cde.pth
100%|██████████| 46827520/46827520 [00:00<00:00, 65104058.86it/s]

In [1]:
# learner

Right. fastai strips the FC layer and its associated pooling layers, and replaces them with adaptive pooling and 2 linear layers with batchNorm and dropout; with a LogSoftmax output layer.


In [12]:
from fastai.models import darknet

In [13]:
darknet.darknet_53


Out[13]:
<function fastai.models.darknet.darknet_53(num_classes=1000)>

In [14]:
tfms = tfms_from_stats(imagenet_stats, sz)
model_data = ImageClassifierData.from_paths(PATH, bs=bs, tfms=tfms, val_name='test')

darknet53 = darknet.darknet_53

In [4]:
# learner = ConvLearner.from_model_data(darknet53(num_classes=10), model_data)
# learner

In [5]:
# learner = ConvLearner.pretrained(darknet53(num_classes=10), model_data)
# learner

3.


In [4]:
%matplotlib inline
%reload_ext autoreload
%autoreload 2
from fastai.conv_learner import *
from fastai.models import darknet
from pathlib import Path
PATH = Path('data/imagenet')
PATH_TRAIN = PATH/'train'

In [5]:
bs = 32
sz = 256

tfms = tfms_from_stats(imagenet_stats, sz)
model_data = ImageClassifierData.from_paths(PATH, bs=bs, tfms=tfms)

darknet53 = darknet.darknet_53

.from_model_data


In [7]:
learner = ConvLearner.from_model_data(darknet53(), model_data)

In [11]:
# learner.summary()

head:

             ('AdaptiveAvgPool2d-232',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 1, 1]),
                           ('nb_params', 0)])),
             ('Flatten-233',
              OrderedDict([('input_shape', [-1, 1024, 1, 1]),
                           ('output_shape', [-1, 1024]),
                           ('nb_params', 0)])),
             ('Linear-234',
              OrderedDict([('input_shape', [-1, 1024]),
                           ('output_shape', [-1, 1000]),
                           ('trainable', True),
                           ('nb_params', 1025000)]))])

learner with NLL loss fails Learning-Rate Finder phase due to negative losses:


In [14]:
learner.lr_find()
learner.sched.plot()


  4%|▎         | 18/487 [01:26<37:32,  4.80s/it, loss=-0.0191] 

In [15]:
learner.crit


Out[15]:
<function torch.nn.functional.nll_loss(input, target, weight=None, size_average=True, ignore_index=-100, reduce=True)>

.pretrained


In [17]:
learner = ConvLearner.pretrained(darknet53(), model_data)


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-17-66ef9014e32e> in <module>()
----> 1 learner = ConvLearner.pretrained(darknet53(), model_data)

~/Kaukasos/FADL2/fastai/conv_learner.py in pretrained(cls, f, data, ps, xtra_fc, xtra_cut, custom_head, precompute, pretrained, **kwargs)
    110                    pretrained=True, **kwargs):
    111         models = ConvnetBuilder(f, data.c, data.is_multi, data.is_reg,
--> 112             ps=ps, xtra_fc=xtra_fc, xtra_cut=xtra_cut, custom_head=custom_head, pretrained=pretrained)
    113         return cls(data, models, precompute, **kwargs)
    114 

~/Kaukasos/FADL2/fastai/conv_learner.py in __init__(self, f, c, is_multi, is_reg, ps, xtra_fc, xtra_cut, custom_head, pretrained)
     38         else: cut,self.lr_cut = 0,0
     39         cut-=xtra_cut
---> 40         layers = cut_model(f(pretrained), cut)
     41         self.nf = model_features[f] if f in model_features else (num_features(layers)*2)
     42         if not custom_head: layers += [AdaptiveConcatPool2d(), Flatten()]

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    355             result = self._slow_forward(*input, **kwargs)
    356         else:
--> 357             result = self.forward(*input, **kwargs)
    358         for hook in self._forward_hooks.values():
    359             hook_result = hook(self, input, result)

~/Kaukasos/FADL2/fastai/models/darknet.py in forward(self, x)
     42         self.layers = nn.Sequential(*layers)
     43 
---> 44     def forward(self, x): return self.layers(x)
     45 
     46 def darknet_53(num_classes=1000):    return Darknet([1,2,8,8,4], num_classes)

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    355             result = self._slow_forward(*input, **kwargs)
    356         else:
--> 357             result = self.forward(*input, **kwargs)
    358         for hook in self._forward_hooks.values():
    359             hook_result = hook(self, input, result)

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/container.py in forward(self, input)
     65     def forward(self, input):
     66         for module in self._modules.values():
---> 67             input = module(input)
     68         return input
     69 

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    355             result = self._slow_forward(*input, **kwargs)
    356         else:
--> 357             result = self.forward(*input, **kwargs)
    358         for hook in self._forward_hooks.values():
    359             hook_result = hook(self, input, result)

~/Kaukasos/FADL2/fastai/models/darknet.py in forward(self, x)
     13         self.relu = nn.LeakyReLU(0.1, inplace=True)
     14 
---> 15     def forward(self, x): return self.relu(self.bn(self.conv(x)))
     16 
     17 class DarknetBlock(nn.Module):

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/module.py in __call__(self, *input, **kwargs)
    355             result = self._slow_forward(*input, **kwargs)
    356         else:
--> 357             result = self.forward(*input, **kwargs)
    358         for hook in self._forward_hooks.values():
    359             hook_result = hook(self, input, result)

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/modules/conv.py in forward(self, input)
    280     def forward(self, input):
    281         return F.conv2d(input, self.weight, self.bias, self.stride,
--> 282                         self.padding, self.dilation, self.groups)
    283 
    284 

~/src/anaconda3/envs/fastai/lib/python3.6/site-packages/torch/nn/functional.py in conv2d(input, weight, bias, stride, padding, dilation, groups)
     82         >>> F.conv2d(inputs, filters, padding=1)
     83     """
---> 84     if input is not None and input.dim() != 4:
     85         raise ValueError("Expected 4D tensor as input, got {}D tensor instead.".format(input.dim()))
     86 

AttributeError: 'bool' object has no attribute 'dim'

In [ ]:
learner.summary()

In [ ]:
learner.lr_find()
learner.sched.plot()

Testing Fix

Testing addition of LogSoftmax layer to fastai.models.darknet.Darknet definition


In [1]:
from pathlib import Path
from fastai.conv_learner import *
from fastai.models import darknet

In [2]:
PATH = Path('data/imagenet')

sz = 256; bs=32

tfms = tfms_from_stats(imagenet_stats, sz)
model_data = ImageClassifierData.from_paths(PATH, bs=bs, tfms=tfms, val_name='train')

darknet53 = darknet.darknet_53

In [3]:
learner = ConvLearner.from_model_data(darknet53(), model_data)

In [4]:
# learner.summary()

In [5]:
learner.lr_find()
learner.sched.plot()


 92%|█████████▏| 448/487 [33:30<02:55,  4.49s/it, loss=28.3]

In [6]:
learner.summary()


Out[6]:
OrderedDict([('Conv2d-1',
              OrderedDict([('input_shape', [-1, 3, 256, 256]),
                           ('output_shape', [-1, 32, 256, 256]),
                           ('trainable', True),
                           ('nb_params', 864)])),
             ('BatchNorm2d-2',
              OrderedDict([('input_shape', [-1, 32, 256, 256]),
                           ('output_shape', [-1, 32, 256, 256]),
                           ('trainable', True),
                           ('nb_params', 64)])),
             ('LeakyReLU-3',
              OrderedDict([('input_shape', [-1, 32, 256, 256]),
                           ('output_shape', [-1, 32, 256, 256]),
                           ('nb_params', 0)])),
             ('ConvBN-4',
              OrderedDict([('input_shape', [-1, 3, 256, 256]),
                           ('output_shape', [-1, 32, 256, 256]),
                           ('nb_params', 0)])),
             ('Conv2d-5',
              OrderedDict([('input_shape', [-1, 32, 256, 256]),
                           ('output_shape', [-1, 64, 127, 127]),
                           ('trainable', True),
                           ('nb_params', 18432)])),
             ('BatchNorm2d-6',
              OrderedDict([('input_shape', [-1, 64, 127, 127]),
                           ('output_shape', [-1, 64, 127, 127]),
                           ('trainable', True),
                           ('nb_params', 128)])),
             ('LeakyReLU-7',
              OrderedDict([('input_shape', [-1, 64, 127, 127]),
                           ('output_shape', [-1, 64, 127, 127]),
                           ('nb_params', 0)])),
             ('ConvBN-8',
              OrderedDict([('input_shape', [-1, 32, 256, 256]),
                           ('output_shape', [-1, 64, 127, 127]),
                           ('nb_params', 0)])),
             ('Conv2d-9',
              OrderedDict([('input_shape', [-1, 64, 127, 127]),
                           ('output_shape', [-1, 32, 127, 127]),
                           ('trainable', True),
                           ('nb_params', 2048)])),
             ('BatchNorm2d-10',
              OrderedDict([('input_shape', [-1, 32, 127, 127]),
                           ('output_shape', [-1, 32, 127, 127]),
                           ('trainable', True),
                           ('nb_params', 64)])),
             ('LeakyReLU-11',
              OrderedDict([('input_shape', [-1, 32, 127, 127]),
                           ('output_shape', [-1, 32, 127, 127]),
                           ('nb_params', 0)])),
             ('ConvBN-12',
              OrderedDict([('input_shape', [-1, 64, 127, 127]),
                           ('output_shape', [-1, 32, 127, 127]),
                           ('nb_params', 0)])),
             ('Conv2d-13',
              OrderedDict([('input_shape', [-1, 32, 127, 127]),
                           ('output_shape', [-1, 64, 127, 127]),
                           ('trainable', True),
                           ('nb_params', 18432)])),
             ('BatchNorm2d-14',
              OrderedDict([('input_shape', [-1, 64, 127, 127]),
                           ('output_shape', [-1, 64, 127, 127]),
                           ('trainable', True),
                           ('nb_params', 128)])),
             ('LeakyReLU-15',
              OrderedDict([('input_shape', [-1, 64, 127, 127]),
                           ('output_shape', [-1, 64, 127, 127]),
                           ('nb_params', 0)])),
             ('ConvBN-16',
              OrderedDict([('input_shape', [-1, 32, 127, 127]),
                           ('output_shape', [-1, 64, 127, 127]),
                           ('nb_params', 0)])),
             ('DarknetBlock-17',
              OrderedDict([('input_shape', [-1, 64, 127, 127]),
                           ('output_shape', [-1, 64, 127, 127]),
                           ('nb_params', 0)])),
             ('Conv2d-18',
              OrderedDict([('input_shape', [-1, 64, 127, 127]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('trainable', True),
                           ('nb_params', 73728)])),
             ('BatchNorm2d-19',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-20',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('nb_params', 0)])),
             ('ConvBN-21',
              OrderedDict([('input_shape', [-1, 64, 127, 127]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('nb_params', 0)])),
             ('Conv2d-22',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 64, 125, 125]),
                           ('trainable', True),
                           ('nb_params', 8192)])),
             ('BatchNorm2d-23',
              OrderedDict([('input_shape', [-1, 64, 125, 125]),
                           ('output_shape', [-1, 64, 125, 125]),
                           ('trainable', True),
                           ('nb_params', 128)])),
             ('LeakyReLU-24',
              OrderedDict([('input_shape', [-1, 64, 125, 125]),
                           ('output_shape', [-1, 64, 125, 125]),
                           ('nb_params', 0)])),
             ('ConvBN-25',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 64, 125, 125]),
                           ('nb_params', 0)])),
             ('Conv2d-26',
              OrderedDict([('input_shape', [-1, 64, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('trainable', True),
                           ('nb_params', 73728)])),
             ('BatchNorm2d-27',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-28',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('nb_params', 0)])),
             ('ConvBN-29',
              OrderedDict([('input_shape', [-1, 64, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('nb_params', 0)])),
             ('DarknetBlock-30',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('nb_params', 0)])),
             ('Conv2d-31',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 64, 125, 125]),
                           ('trainable', True),
                           ('nb_params', 8192)])),
             ('BatchNorm2d-32',
              OrderedDict([('input_shape', [-1, 64, 125, 125]),
                           ('output_shape', [-1, 64, 125, 125]),
                           ('trainable', True),
                           ('nb_params', 128)])),
             ('LeakyReLU-33',
              OrderedDict([('input_shape', [-1, 64, 125, 125]),
                           ('output_shape', [-1, 64, 125, 125]),
                           ('nb_params', 0)])),
             ('ConvBN-34',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 64, 125, 125]),
                           ('nb_params', 0)])),
             ('Conv2d-35',
              OrderedDict([('input_shape', [-1, 64, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('trainable', True),
                           ('nb_params', 73728)])),
             ('BatchNorm2d-36',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-37',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('nb_params', 0)])),
             ('ConvBN-38',
              OrderedDict([('input_shape', [-1, 64, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('nb_params', 0)])),
             ('DarknetBlock-39',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 128, 125, 125]),
                           ('nb_params', 0)])),
             ('Conv2d-40',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 294912)])),
             ('BatchNorm2d-41',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-42',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-43',
              OrderedDict([('input_shape', [-1, 128, 125, 125]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-44',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 32768)])),
             ('BatchNorm2d-45',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-46',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-47',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-48',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 294912)])),
             ('BatchNorm2d-49',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-50',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-51',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('DarknetBlock-52',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-53',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 32768)])),
             ('BatchNorm2d-54',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-55',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-56',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-57',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 294912)])),
             ('BatchNorm2d-58',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-59',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-60',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('DarknetBlock-61',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-62',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 32768)])),
             ('BatchNorm2d-63',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-64',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-65',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-66',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 294912)])),
             ('BatchNorm2d-67',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-68',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-69',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('DarknetBlock-70',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-71',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 32768)])),
             ('BatchNorm2d-72',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-73',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-74',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-75',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 294912)])),
             ('BatchNorm2d-76',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-77',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-78',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('DarknetBlock-79',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-80',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 32768)])),
             ('BatchNorm2d-81',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-82',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-83',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-84',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 294912)])),
             ('BatchNorm2d-85',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-86',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-87',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('DarknetBlock-88',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-89',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 32768)])),
             ('BatchNorm2d-90',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-91',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-92',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-93',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 294912)])),
             ('BatchNorm2d-94',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-95',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-96',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('DarknetBlock-97',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-98',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 32768)])),
             ('BatchNorm2d-99',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-100',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-101',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-102',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 294912)])),
             ('BatchNorm2d-103',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-104',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-105',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('DarknetBlock-106',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-107',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 32768)])),
             ('BatchNorm2d-108',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 256)])),
             ('LeakyReLU-109',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-110',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 128, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-111',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 294912)])),
             ('BatchNorm2d-112',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-113',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('ConvBN-114',
              OrderedDict([('input_shape', [-1, 128, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('DarknetBlock-115',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 256, 62, 62]),
                           ('nb_params', 0)])),
             ('Conv2d-116',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1179648)])),
             ('BatchNorm2d-117',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-118',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-119',
              OrderedDict([('input_shape', [-1, 256, 62, 62]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-120',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 131072)])),
             ('BatchNorm2d-121',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-122',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-123',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-124',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1179648)])),
             ('BatchNorm2d-125',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-126',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-127',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('DarknetBlock-128',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-129',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 131072)])),
             ('BatchNorm2d-130',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-131',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-132',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-133',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1179648)])),
             ('BatchNorm2d-134',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-135',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-136',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('DarknetBlock-137',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-138',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 131072)])),
             ('BatchNorm2d-139',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-140',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-141',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-142',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1179648)])),
             ('BatchNorm2d-143',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-144',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-145',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('DarknetBlock-146',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-147',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 131072)])),
             ('BatchNorm2d-148',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-149',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-150',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-151',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1179648)])),
             ('BatchNorm2d-152',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-153',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-154',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('DarknetBlock-155',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-156',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 131072)])),
             ('BatchNorm2d-157',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-158',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-159',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-160',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1179648)])),
             ('BatchNorm2d-161',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-162',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-163',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('DarknetBlock-164',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-165',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 131072)])),
             ('BatchNorm2d-166',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-167',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-168',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-169',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1179648)])),
             ('BatchNorm2d-170',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-171',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-172',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('DarknetBlock-173',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-174',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 131072)])),
             ('BatchNorm2d-175',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-176',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-177',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-178',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1179648)])),
             ('BatchNorm2d-179',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-180',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-181',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('DarknetBlock-182',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-183',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 131072)])),
             ('BatchNorm2d-184',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 512)])),
             ('LeakyReLU-185',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-186',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 256, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-187',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1179648)])),
             ('BatchNorm2d-188',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-189',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('ConvBN-190',
              OrderedDict([('input_shape', [-1, 256, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('DarknetBlock-191',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 512, 30, 30]),
                           ('nb_params', 0)])),
             ('Conv2d-192',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 4718592)])),
             ('BatchNorm2d-193',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 2048)])),
             ('LeakyReLU-194',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('ConvBN-195',
              OrderedDict([('input_shape', [-1, 512, 30, 30]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('Conv2d-196',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 524288)])),
             ('BatchNorm2d-197',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-198',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('nb_params', 0)])),
             ('ConvBN-199',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('nb_params', 0)])),
             ('Conv2d-200',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 4718592)])),
             ('BatchNorm2d-201',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 2048)])),
             ('LeakyReLU-202',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('ConvBN-203',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('DarknetBlock-204',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('Conv2d-205',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 524288)])),
             ('BatchNorm2d-206',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-207',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('nb_params', 0)])),
             ('ConvBN-208',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('nb_params', 0)])),
             ('Conv2d-209',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 4718592)])),
             ('BatchNorm2d-210',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 2048)])),
             ('LeakyReLU-211',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('ConvBN-212',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('DarknetBlock-213',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('Conv2d-214',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 524288)])),
             ('BatchNorm2d-215',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-216',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('nb_params', 0)])),
             ('ConvBN-217',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('nb_params', 0)])),
             ('Conv2d-218',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 4718592)])),
             ('BatchNorm2d-219',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 2048)])),
             ('LeakyReLU-220',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('ConvBN-221',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('DarknetBlock-222',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('Conv2d-223',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 524288)])),
             ('BatchNorm2d-224',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 1024)])),
             ('LeakyReLU-225',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('nb_params', 0)])),
             ('ConvBN-226',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 512, 14, 14]),
                           ('nb_params', 0)])),
             ('Conv2d-227',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 4718592)])),
             ('BatchNorm2d-228',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('trainable', True),
                           ('nb_params', 2048)])),
             ('LeakyReLU-229',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('ConvBN-230',
              OrderedDict([('input_shape', [-1, 512, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('DarknetBlock-231',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 14, 14]),
                           ('nb_params', 0)])),
             ('AdaptiveAvgPool2d-232',
              OrderedDict([('input_shape', [-1, 1024, 14, 14]),
                           ('output_shape', [-1, 1024, 1, 1]),
                           ('nb_params', 0)])),
             ('Flatten-233',
              OrderedDict([('input_shape', [-1, 1024, 1, 1]),
                           ('output_shape', [-1, 1024]),
                           ('nb_params', 0)])),
             ('Linear-234',
              OrderedDict([('input_shape', [-1, 1024]),
                           ('output_shape', [-1, 1000]),
                           ('trainable', True),
                           ('nb_params', 1025000)])),
             ('LogSoftmax-235',
              OrderedDict([('input_shape', [-1, 1000]),
                           ('output_shape', [-1, 1000]),
                           ('nb_params', 0)]))])

In [7]:
learner.crit


Out[7]:
<function torch.nn.functional.nll_loss(input, target, weight=None, size_average=True, ignore_index=-100, reduce=True)>

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]: