DomainTransferNetwork.pytorch
DomainTransferNetwork.pytorch copied to clipboard
target -= 1
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
how to solve the program
you can remove this line