qiaoguan / Person-reid-GAN-pytorch

A Pytorch Implementation of "Unlabeled Samples Generated by GAN Improve the Person Re-identification Baseline in vitro"(ICCV17)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A comment # Here is a problem

jpainam opened this issue · comments

logpt=logpt.gather(1,target) # here is a problem

While reading your code, I saw this line of code, is it a comment to be taken into account?
And what exactly is the problem?
Thank

commented

do not need to take into account, just leave it alone

hello, i have a trouble when i run train_baseline.py as follow:
Traceback (most recent call last):
File "train_baseline.py", line 347, in
num_epochs=130)
File "train_baseline.py", line 246, in train_model
loss = criterion(outputs,labels,flags)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "train_baseline.py", line 168, in forward
logpt=logpt.gather(1,target) # here is a problem
RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/aten/src/THC/generic/THCTensorScatterGather.cu:66
whether the gpu is used, the running result is the same, how to solve it?
and my input is CUDA_LAUNCH_BLOCKING=1 python train_baseline.py --name ft_DesNet121 --data_dir /home/ztt/lufei/Person-reid-GAN-pytorch-master/Market/pytorch --batchsize 16 --erasing_p 0.8 --use_dense

commented

Hello, I have the same trouble, did anyone solve it?

/pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [0,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [9,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [10,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [11,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [15,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [16,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [17,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [19,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [22,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [23,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [27,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. /pytorch/torch/lib/THC/THCTensorScatterGather.cu:97: void THCudaTensor_gatherKernel(TensorInfo<Real, IndexType>, TensorInfo<Real, IndexType>, TensorInfo<long, IndexType>, int, IndexType) [with IndexType = unsigned int, Real = float, Dims = 2]: block: [0,0,0], thread: [30,0,0] AssertionindexValue >= 0 && indexValue < src.sizes[dim]failed. THCudaCheck FAIL file=/pytorch/torch/lib/THC/generic/THCTensorScatterGather.cu line=66 error=59 : device-side assert triggered Traceback (most recent call last): File "/home/sobey123/.pycharm_helpers/pydev/pydevd.py", line 1664, in <module> main() File "/home/sobey123/.pycharm_helpers/pydev/pydevd.py", line 1658, in main globals = debugger.run(setup['file'], None, None, is_module) File "/home/sobey123/.pycharm_helpers/pydev/pydevd.py", line 1068, in run pydev_imports.execfile(file, globals, locals) # execute the script File "/home/sobey123/code/project/Person-reid-GAN-pytorch/train_baseline.py", line 357, in <module> num_epochs=130) File "/home/sobey123/code/project/Person-reid-GAN-pytorch/train_baseline.py", line 254, in train_model loss = criterion(outputs, labels, flags) File "/home/sobey123/miniconda2/envs/ReID_GAN/lib/python2.7/site-packages/torch/nn/modules/module.py", line 357, in __call__ result = self.forward(*input, **kwargs) File "/home/sobey123/code/project/Person-reid-GAN-pytorch/train_baseline.py", line 174, in forward logpt = logpt.gather(1, target) # here is a problem RuntimeError: cuda runtime error (59) : device-side assert triggered at /pytorch/torch/lib/THC/generic/THCTensorScatterGather.cu:66
it seems the indexValue are out of bound, but I wonder index for what.

commented

I solve it.
just modify the script changeIndex.py at line 20 adn 21 as follow
train_save_path = original_path + '/train_new' data_path = original_path + '/train'
and run the script.

commented

yes, someone have issued this question before,just change the index of the label using changeIndex.py!

@ShiinaMitsuki the code you modified has returned at line 17 and 18 in changeIndex.py, weather your mean is take them at line 21?

commented

@lufei92
image

here's the code of changeindex.py, I didnt see any return there.