Open
Description
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
Labels
No labels