Hello everyone,
Recently I got a very strange error of
RuntimeError: CUDA error: device-side assert triggered
Basically I have two loss function for adversarial like attack.
loss_function   = nn.CrossEntropyLoss()
loss_function2   = nn.CrossEntropyLoss()
With a reference pretrain network
ref_net = torch.load(os.path.join(ref_path, 'best_%d.pth' % ref_epoch))

# Freeze one reference pre-trained network 
for p in ref_net.parameters():
     p.requires_grad = False

Then during the training I calculate
        loss = loss_function(outputs, labels)

        ref_outputs = ref_net(meas)
        loss2 = loss_function2(ref_outputs, labels) 
        loss = loss + alpha* loss2

The error stop at the loss = loss + alpha* loss2 which mean I could not add these two loss together?
Any idea to resolve this?
Thank you