autonomousvision / projected-gan

[NeurIPS'21] Projected GANs Converge Faster
MIT License
883 stars 96 forks source link

colab doesn't work #90

Open dkoes opened 2 years ago

dkoes commented 2 years ago

Trying to run the example colab notebook fails with the error AttributeError: 'EfficientNet' object has no attribute 'act1'

This is because there is no act1 attribute in the model returned by timm.create_model('tf_efficientnet_lite0', pretrained=True)

It is also the case that this model only has 7 blocks, yet _make_efficientnet seems to assume there's at least nine, which is concerning:

def _make_efficientnet(model):
    pretrained = nn.Module()
    pretrained.layer0 = nn.Sequential(model.conv_stem, model.bn1, model.act1, *model.blocks[0:2])
    pretrained.layer1 = nn.Sequential(*model.blocks[2:3])
    pretrained.layer2 = nn.Sequential(*model.blocks[3:5])
    pretrained.layer3 = nn.Sequential(*model.blocks[5:9])
    return pretrained
woctezuma commented 2 years ago
nhatdfo commented 1 year ago

!pip install timm==0.5.4 try this