Skip to content

Use It as a backbone for different purposes ?  #246

Open
@ertugrulsmz

Description

@ertugrulsmz

I would like to use efficientnet as a backbone for object detection. However non of my attempts yield results.
What do you suggest ? (In resnet implementation this code snippet works ...)

from efficientnet_pytorch import EfficientNet
model = EfficientNet.from_pretrained('efficientnet-b6')
modules=list(model.children())[:-2] #remove last 2 layers only need feature extractor
modelbackbone =nn.Sequential(*modules)

img = torch.Tensor(3, 299, 299).normal_() # random image
img = torch.unsqueeze(img, 0) # Add dimension 0 to tensor
img_var = Variable(img) # assign it to a variable
features_var = modelbackbone(img_var)

ERROR : forward() takes 1 positional argument but 2 were given

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions