DomainTransferNetwork.pytorch icon indicating copy to clipboard operation
DomainTransferNetwork.pytorch copied to clipboard

target -= 1

Open caogule opened this issue 6 years ago • 1 comments

the targer emerge -1,the code current

for i, (input_, target) in enumerate(val_loader): input = torch.FloatTensor(input_.size(0), 3, input_.size(2), input_.size(3)) if opt.dataset == 'mnist': input[:,0,:,:].copy_(input_) input[:,1,:,:].copy_(input_) input[:,2,:,:].copy_(input_) else: target -= 1

error

/pytorch/torch/lib/THCUNN/ClassNLLCriterion.cu:101: 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: [0,0,0] Assertion t >= 0 && t < n_classes failed. /pytorch/torch/lib/THCUNN/ClassNLLCriterion.cu:101: 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: [9,0,0] Assertion t >= 0 && t < n_classes failed. /pytorch/torch/lib/THCUNN/ClassNLLCriterion.cu:101: 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: [14,0,0] Assertion t >= 0 && t < n_classes failed. THCudaCheck FAIL file=/pytorch/torch/lib/THC/generic/THCStorage.c line=36 error=59 : device-side assert triggered Traceback (most recent call last): File "main_recog.py", line 213, in train(dataloader, netE, criterionCE, optimizerE, epoch) File "main_recog.py", line 187, in train losses.update(loss.data[0], input.size(0)) RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/torch/lib/THC/generic/THCStorage.c:36

how to solve the program

caogule avatar Jun 09 '18 16:06 caogule

you can remove this line

zhyj3038 avatar May 17 '19 07:05 zhyj3038