You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How you installed PyTorch (conda, pip, source): source
Python version: 3.6
CUDA/cuDNN version: 8.0
GPU models and configuration: GTX1080
GCC version (if compiling from source): VS2015
I am doing some image classification and I have a model which uses nn.NLLLoss2d as loss function.
The size of images are 1024*512. I can run this model on GPU when I use this kind of image. But when I resize images to 512*256, the model will fail in some images.
I have located the problem in nn.NLLLoss2d() function. The function can return loss without problems, but when I try to access the loss, such as loss.data[0] or loss.backward(), the program will break down:
RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at d:\pytorch\pytorch\torch\lib\thc\generic/THCStorage.cu:58
And when I move the whole model to cpu and use images of 1024*512, the model also fails in some images:
The size of input tensor and target are [1, 9, 512, 1024] and [1, 512, 1024] and I am pretty sure that the value of target is 0<=value<9.
I tried it on my macbook pro and I have the same problem.
I find the problem, when I resize the mask, some objects overlap with another and the values of mask have changed. But there is no bug report on GPU. It takes me a whole day to find the problem.
At @Mabinogiysk could you provide us with an example of how you're resizing a mask please? It would be great if there was an error message for something that could turn perilous like it sounds like in your case.
The first one says that your targets are out of range (you only have 3 input classes and put 6 into targets). How did you get the second error? This should never happen
Activity
MabinogiX commentedon Feb 28, 2018
I find the problem, when I resize the mask, some objects overlap with another and the values of mask have changed. But there is no bug report on GPU. It takes me a whole day to find the problem.
ssnl commentedon Feb 28, 2018
@Mabinogiysk In general, you don't want to
resizea noncontiguous tensor.zou3519 commentedon Mar 5, 2018
At @Mabinogiysk could you provide us with an example of how you're resizing a mask please? It would be great if there was an error message for something that could turn perilous like it sounds like in your case.
MabinogiX commentedon Mar 15, 2018
This is the code:
This code can run without any errors. If I remove
.cuda(), there will be some error:outputs:
And I hope the message can be more specific. I had been stuck for several days and tried to figure out what cur_target is.
MabinogiX commentedon Mar 15, 2018
I am not sure what cause the problem:
apaszke commentedon Mar 15, 2018
The first one says that your targets are out of range (you only have 3 input classes and put 6 into targets). How did you get the second error? This should never happen
MabinogiX commentedon Mar 21, 2018
I don't know. I think it related to my memory, which is too small.
MabinogiX commentedon Mar 21, 2018
When I fixed the first error, the second one disappeared too.
zou3519 commentedon Aug 28, 2018
Going to close this due to inability to reproduce and no other similar reports. @Mabinogiysk please feel free to reopen this issue if it persists.
FionaFN commentedon Mar 3, 2019
I also meet the very similar problem when trying to run DRN on Linemod Dataset... Still trying to figure it out
test_decomp: remove stale XPU grid_sample expected failure