d-li14/face-attribute-prediction

Expected more than 1 value per channel when training

mathpopo opened this issue · 1 comments

class fc_block(nn.Module):
def init(self, inplanes, planes, drop_rate=0.15):
super(fc_block, self).init()
self.fc = nn.Linear(inplanes, planes)
self.bn = nn.BatchNorm1d(planes)
if drop_rate > 0:
self.dropout = nn.Dropout(drop_rate)
self.relu = nn.ReLU(inplace=True)
self.drop_rate = drop_rate

def forward(self, x):
    x = self.fc(x)
    x = self.bn(x)
    if self.drop_rate > 0:
        x = self.dropout(x)
    x = self.relu(x)
    return x

self.bn = nn.BatchNorm1d(planes)
Expected more than 1 value per channel when training