I have met some problems about BCEloss.
The error is that:
/opt/conda/conda-bld/pytorch_1524577177097/work/aten/src/THCUNN/ClassNLLCriterion.cu:105: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int, long) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [4,0,0] Assertion t >= 0 && t < n_classes failed.
/opt/conda/conda-bld/pytorch_1524577177097/work/aten/src/THCUNN/ClassNLLCriterion.cu:105: void cunn_ClassNLLCriterion_updateOutput_kernel(Dtype *, Dtype *, Dtype *, long *, Dtype *, int, int, int, int, long) [with Dtype = float, Acctype = float]: block: [0,0,0], thread: [5,0,0] Assertion t >= 0 && t < n_classes failed.
Traceback (most recent call last):
File “main.py”, line 64, in 
message = initrun(dataloader, netD, netG, args)
File “/home/student1/zps/drgan/run/run.py”, line 17, in initrun
mes = train_single_DRGAN(dataloader, netD, netG, args)
File “/home/student1/zps/drgan/run/train_single_DRGAN.py”, line 201, in train_single_DRGAN
L_d_gan = BCE_Loss(real_output[:, Nd].sigmoid(), batch_real_label) + BCE_Loss(
File “/home/student1/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py”, line 491, in call
result = self.forward(*input, **kwargs)
File “/home/student1/anaconda2/lib/python2.7/site-packages/torch/nn/modules/loss.py”, line 433, in forward
reduce=self.reduce)
File “/home/student1/anaconda2/lib/python2.7/site-packages/torch/nn/functional.py”, line 1483, in binary_cross_entropy
return torch._C._nn.binary_cross_entropy(input, target, weight, size_average, reduce)
RuntimeError: cudaEventCreateWithFlags in future ctor: device-side assert triggered
Does anyone meet this problem ?
Thanks a lot for any help!!