February 2018
Intermediate to advanced
262 pages
6h 59m
English
Torchvision has a pretrained DenseNet model with different layer options (121, 169, 201, 161). We have chosen the model with 121 layers. As discussed, the DenseNet has two modules: features (containing the dense blocks), and classifier (fully connected block). As we are using DenseNet as an image feature extractor, we will only use the feature module:
my_densenet = densenet121(pretrained=True).featuresif is_cuda: my_densenet = my_densenet.cuda()for p in my_densenet.parameters(): p.requires_grad = False
Let's extract the DenseNet features from the images.
Read now
Unlock full access