i want to implement a pytroch nn.class with a subclass in it for a neural network but i am getting
this error
raise NotImplementedError
NotImplementedError
pleae some one can figure out
This (ConvBNR) is the sub class which i want to implemet in the main class(DPclass) of neural netwrok
class ConvBNR(nn.Module)
def __init__(self,in_channels, out_channels):
#def __init__():
super(ConvBNR,self).__init__()
self.net = nn.Sequential(
nn.Conv2d(32,32,3, 1, 1),
nn.BatchNorm2d(32),
nn.ReLU()
)
def call(self, x, training=None):
x = self.net(x, training=training)
return x
This is my main class of NN
class (DPclass) (nn.Module):
def __init__(self):
#super(DPclass)()
super().__init__()
self.start = nn.Sequential(
nn.Conv2d(in_channels=3, out_channels=32, kernel_size=3, stride=1, padding=1),
nn.BatchNorm2d(32),
nn.ELU()
#nn.Dropout(0.25)
)
#self.start2 = ConvBNRelu(32,64,3,1,1)
self.start2 = ConvBNRelu(32,64)
some other layers.........
def forward(self, x):
A = self.start(x)#here1
print("A.shape1",A.shape)
A = self.start2(x)#here1
.........