Hey everyone,
I try to apply CrossEntropyLoss for segmentaion, as part off the mission of a net, and I need to calculate the variance of the output (which means that I have to use: reduction=‘none’ ) .
I try to run these lines:
    semantic_criterion = nn.CrossEntropyLoss(reduction='none')
    semLoss = semantic_criterion(torch.abs(semantic_pred[:,:,:,:]),BackgtoundSemantics[:,0,:,:] )
    varS = torch.var(semLoss)

the first 2 lines are working well, and the third line create this error:
*** RuntimeError: cuda runtime error (700) : an illegal memory access was encountered at C:/cb/pytorch_1000000000000/work/aten/src\THC/THCReduceAll.cuh:327
while debugging I tryed to run only th name of the tensor ‘semLoss’ and got that error:
*** RuntimeError: cuda runtime error (700) : an illegal memory access was encountered at …\aten\src\THC\THCCachingHostAllocator.cpp:278
and when i tryed to run again the 2nd line I got:
*** RuntimeError: CUDA error: an illegal memory access was encountered
maybe someone faced that error before?
thanks for your help,
Avi