Hi everyone,
I would like to use an EfficientNet for image classification. Since my inputimage has 6 instead of 3 channels, I guess I need to change some layers. Currently I define my model as follows:
class Classifier(nn.Module):
def init(self,n_classes = 4):
super(Classifier, self).init()
self.effnet = EfficientNet.from_name(‘efficientnet-b4’)
self.l1 = nn.Linear(2000 , 256)
self.dropout = nn.Dropout(0.5)
self.l2 = nn.Linear(256,n_classes) # number of classes is 4
self.relu = nn.LeakyReLU()
def forward(self, input):
x = self.effnet(input)
x = x.view(x.size(0),-1)
x = self.dropout(self.relu(self.l1(x)))
x = self.l2(x)
return x
Can someone tell me how I can change layers of the EfficientNet in pytorch?