torch.nn.BCELoss are unsafe to autocast
Default initial loss:
lobj = torch.zeros(1, device=device)
Temporary solution:
bce_loss = nn.BCEWithLogitsLoss(reduction="sum").to(device)
Bcewith logitsloss predicts no need for home sigmoid, tags
torch.nn.BCELoss are unsafe to autocast
Default initial loss:
lobj = torch.zeros(1, device=device)
Temporary solution:
bce_loss = nn.BCEWithLogitsLoss(reduction="sum").to(device)
Bcewith logitsloss predicts no need for home sigmoid, tags
Property error, module cannot assign value before initialization. The error may be caused by:
The initialization of the parent class is not added to the initialization of the class, for example:
class Conv2dBatchLeaky(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride, leaky_slope=0.1):
self.in_channels = in_channels
self.out_channels = out_channels
self.kernel_size = kernel_size
resolvent:
add:
super(Conv2dBatchLeaky, self).__ init__()
The code is as follows:
class Conv2dBatchLeaky(nn.Module):
def __init__(self, in_channels, out_channels, kernel_size, stride, leaky_slope=0.1):
super(Conv2dBatchLeaky, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.kernel_size = kernel_size