Open lin1061991611 opened 3 years ago
Full error report as:
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCCachingHostAllocator.cpp line=278 error=77 : an illegal memory access was encountered
Traceback (most recent call last):
File "/home/yaogan_504/pycharm-community-2020.2.2/plugins/python-ce/helpers/pydev/pydevd.py", line 1448, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/yaogan_504/pycharm-community-2020.2.2/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/media/yaogan_504/5E4006134005F297/linhemin/GRNet-master/runner.py", line 76, in <module>
main()
File "/media/yaogan_504/5E4006134005F297/linhemin/GRNet-master/runner.py", line 58, in main
train_net(cfg)
File "/media/yaogan_504/5E4006134005F297/linhemin/GRNet-master/core/train.py", line 112, in train_net
sparse_ptcloud, dense_ptcloud = grnet(data)
File "/home/yaogan_504/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
result = self.forward(*input, **kwargs)
File "/home/yaogan_504/anaconda3/lib/python3.7/site-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
return self.module(*inputs[0], **kwargs[0])
File "/home/yaogan_504/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
result = self.forward(*input, **kwargs)
File "/media/yaogan_504/5E4006134005F297/linhemin/GRNet-master/models/grnet.py", line 138, in forward
sparse_cloud = self.point_sampling(sparse_cloud, partial_cloud)
File "/home/yaogan_504/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in __call__
result = self.forward(*input, **kwargs)
File "/media/yaogan_504/5E4006134005F297/linhemin/GRNet-master/models/grnet.py", line 21, in forward
pred_cloud = torch.cat([partial_cloud, pred_cloud], dim=1)
RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at /pytorch/aten/src/THC/THCCachingHostAllocator.cpp:278
I've never met the issue before. There are no other users reporting similar issues. How about the ShapeNet dataset?
hi @hzxie I also meet the same error. RuntimeError: CUDA error: an illegal memory access was encountered
Here is something may be helpful and may be something of feature sampling has error?
and it reports the "point features" has NaN is True. tensor(True, device='cuda:0') =================point features after feature sample=================
Looking for your reply. Best
@yjcaimeow
Maybe the coordinates of the points in the sparse_cloud
out of the range (-1 , 1)
.
@hzxie
I check the range of sparse_cloud and it is in [-1, 1]. The sparse cloud is get from the gridding_rev operation.
I also try to *0.5. The same error also exist. :(
hi, @lin1061991611 Maybe your extensions are complied with a not corresponding version of cuda or cudnn? I've met this issue with a tensorflow model once.
has anyone solved this issue? I'm using pytorch=1.4.0, cuda=10.1 with a fresh conda environment. Still getting this error.
has anyone solved this issue? I'm using pytorch=1.4.0, cuda=10.1 with a fresh conda environment. Still getting this error.
I think this is because its extension "griding". Its output tensors refuse to be readed, even if get printed, or refered to a specific GPU device.
Has anyone solved this issue? I'm using pytorch=1.8.1+cu111 with a fresh conda environment. Still getting this error.
I found the reason for my problem because the training data was not normalized.
I also meet the same problem,. when I use my own dataset to inference, the program stops here:
class GriddingFunction(torch.autograd.Function):
@staticmethod
def forward(ctx, scale, ptcloud):
grid, grid_pt_weights, grid_pt_indexes = gridding.forward(-scale, scale - 1, -scale, scale - 1, -scale,
scale - 1, ptcloud)
the original input to the GriddingFunction( that is:gridding.forward(...)) is:
partial_cloud.size: torch.Size([1, 2048, 3]) partial_cloud coordinate: tensor([[[ 95.9131, -43.8667, 407.3000], [ 6.2308, -5.8511, 400.2000], [ 93.6227, -41.6913, 406.4000], ..., [ 40.1768, 4.3794, 399.9000], [ 76.5817, -5.4377, 399.9000], [ 56.0437, -37.4217, 396.4000]]], device='cuda:0')
but I saw the reply from upstairs, thought it may because of the lack of normalized. Then I normalized the partial_cloud, input the GriddingFunction( that is:gridding.forward(...)) , BUT still not worked.
normalized_partial_cloud: tensor([[[ 0.8058, -0.2408, -0.2035], [-0.9362, 0.6257, -0.6163], [ 0.7613, -0.1912, -0.2558], ..., [-0.2768, 0.8588, -0.6337], [ 0.4303, 0.6351, -0.6337], [ 0.0314, -0.0939, -0.8372]]], device='cuda:0')
Then I try to print relative information like:
print("grid: ", grid)
print("grid_pt_weights: ", grid_pt_weights)
print("grid_pt_indexes: ", grid_pt_indexes)
But before printing this, the program has reported an error:
torch.Size([1, 262144]) torch.Size([1, 2048, 8, 3]) torch.Size([1, 2048, 8]) THCudaCheck FAIL file=/pytorch/aten/src/THC/THCReduceAll.cuh line=327 error=700 : an illegal memory access was encountered grid: Traceback (most recent call last): File "runner.py", line 77, in
main() File "runner.py", line 68, in main inference_net(cfg) File "/root/autodl-tmp/GRNet/core/inference.py", line 59, in inference_net sparse_ptcloud, dense_ptcloud = grnet(data) File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, kwargs) File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 153, in forward return self.module(*inputs[0], *kwargs[0]) File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(input, kwargs) File "/root/autodl-tmp/GRNet/models/grnet.py", line 125, in forward pt_features_64_l = self.gridding(normalized_partial_cloud).view(-1, 1, 64, 64, 64) File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 550, in call result = self.forward(*input, **kwargs) File "/root/autodl-tmp/GRNet/extensions/gridding/init.py", line 52, in forward grids.append(GriddingFunction.apply(self.scale, p)) File "/root/autodl-tmp/GRNet/extensions/gridding/init.py", line 23, in forward print("grid: ", grid) File "/root/miniconda3/lib/python3.8/site-packages/torch/tensor.py", line 162, in repr return torch._tensor_str._str(self) File "/root/miniconda3/lib/python3.8/site-packages/torch/_tensor_str.py", line 315, in _str tensor_str = _tensor_str(self, indent) File "/root/miniconda3/lib/python3.8/site-packages/torch/_tensor_str.py", line 213, in _tensor_str formatter = _Formatter(get_summarized_data(self) if summarize else self) File "/root/miniconda3/lib/python3.8/site-packages/torch/_tensor_str.py", line 88, in init nonzero_finite_vals = torch.masked_select(tensor_view, torch.isfinite(tensor_view) & tensor_view.ne(0)) RuntimeError: cuda runtime error (700) : an illegal memory access was encountered at /pytorch/aten/src/THC/THCReduceAll.cuh:327
How can I fix this? Please advise, thank you.
Hi,when i run this code with my own dataset,it errors as:
Did you meet the issue before? Thanks for advance.