Lets consider the below code
model1 = torchvision.models.resnet18(num_classes = 7)
I am going to use torchvision Resnet18 model. I am in doubt whther these model contains Batch Normalization layer or not.
Lets consider the below code
model1 = torchvision.models.resnet18(num_classes = 7)
I am going to use torchvision Resnet18 model. I am in doubt whther these model contains Batch Normalization layer or not.
You can print
the model and would see it contains batchnorm layers:
model = torchvision.models.resnet18(num_classes = 7)
print(model)
ResNet(
(conv1): Conv2d(3, 64, kernel_size=(7, 7), stride=(2, 2), padding=(3, 3), bias=False)
(bn1): BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
(relu): ReLU(inplace=True)
...