Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

an illegal memory access was encountered #16

Open
dingjibang opened this issue Sep 26, 2018 · 6 comments
Open

an illegal memory access was encountered #16

dingjibang opened this issue Sep 26, 2018 · 6 comments

Comments

@dingjibang
Copy link

项目下下来简单填了几个answer和question然后跑起来测试,发现可以运行并且效果还不错,就搞了将近2mb的answer和question,在preprocessing阶段通过,开始训练的时候就提示下面的错误了。

THCudaCheck FAIL file=C:/new-builder_3/win-wheel/pytorch/aten/src/ATen/native/cuda/Embedding.cu line=247 error=77 : an illegal memory access was encountered
Traceback (most recent call last):
File "seq2seq.py", line 436, in
seq.train()
File "seq2seq.py", line 210, in train
loss, logits = self.step(inputs, targets, self.max_length)
File "seq2seq.py", line 265, in step
loss.backward()
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\torch\tensor.py", line 93, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\torch\autograd_init_.py", line 90, in backward
allow_unreachable=True) # allow_unreachable flag
RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at C:/new-builder_3/win-wheel/pytorch/aten/src/ATen/native/cuda/Embedding.cu:2
47

一脸懵逼,我该怎么办

@dingjibang
Copy link
Author

cuda9.0,系统win10,py3.5

@yanwii
Copy link
Owner

yanwii commented Sep 26, 2018

使用CUDA_LAUNCH_BLOCKING=1 python3 seq2seq.py train 可以看到更多信息

@dingjibang
Copy link
Author

现在的信息已经是blocking = 1时候的了
顺便贴上blocking = 0的时候的信息

THCudaCheck FAIL file=c:\new-builder_3\win-wheel\pytorch\aten\src\thc\THCReduceAll.cuh line=317 error=77 : an illegal memory access was encountered
Traceback (most recent call last):
File "seq2seq.py", line 436, in
seq.train()
File "seq2seq.py", line 210, in train
loss, logits = self.step(inputs, targets, self.max_length)
File "seq2seq.py", line 266, in step
torch.nn.utils.clip_grad_norm(self.encoder.parameters(), clip)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\torch\nn\utils\clip_grad.py", line 51, in clip_grad_norm
return clip_grad_norm_(parameters, max_norm, norm_type)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python35\lib\site-packages\torch\nn\utils\clip_grad.py", line 32, in clip_grad_norm_
param_norm = p.grad.data.norm(norm_type)
RuntimeError: cuda runtime error (77) : an illegal memory access was encountered at c:\new-builder_3\win-wheel\pytorch\aten\src\thc\THCReduceAll.cuh:317

0或者1,报出来的信息都是一样的,没有更多或者更少,就是报错的行数不一样

@yanwii
Copy link
Owner

yanwii commented Sep 27, 2018

可否把数据发我一份?

@liutianling
Copy link

@dingjibang 这个问题你解决了吗?我也遇到了这样的问题.
@yanwii 但是我关掉GPU后epoch跑到4000,报错确实段错误

@ailovejinx
Copy link

你好,请问这个问题你解决了吗,我也遇到了这样的问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants