Skip to content

EfficientNet B0-B7 implemented in convinient way with .features and .classifier layers with pretrained on ImageNet weights.

Notifications You must be signed in to change notification settings

linkyeu/efficientnet_pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

EfficientNet (PyTorch)

My implementation of Efficient-Net in nn.Sequence manner (i.e. without nn.Module) for feature extraction layers. This approach is more convinient for applying Class Activation Mapping or working with fast.ai library.

About EfficientNet

To load pre-trained model simply run

import efficientnet
model = efficientnet.efficientnet(net="B4", pretrained=True)

where B4 could be replaced with any model scale from B0 to B7. Weights will be downloaded automatically.

For features extraction simply run

import efficientnet
image = torch.randn(1, 3, 300, 300)
model = efficientnet.efficientnet(net="B4", pretrained=True)
features = model.features(image)

In same way you can get output from any layer.

Weights were copied from here and adopted for my implementation.

About

EfficientNet B0-B7 implemented in convinient way with .features and .classifier layers with pretrained on ImageNet weights.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages