HELP ! RuntimeError: CUDA error: device-side assert triggered #2
Comments
I queried this problem to Dr. Lample. He is so kindhearted that he replied me quikly. Hi Weiwei, I'm not sure what is happening, but this is the kind of issues that usually happen when one is indexing an array by a higher value than what is available (for instance the lookup table has 100 embeddings, but you query the word 105 or something). The problem with CUDA is that it's not clear where the issue is happening because it is running asynchronously. Did you modify the code? What is the command you ran? Also, would you mind asking the issue on the Github? In case someone else faces the same problem. Thank you, |
I am so exciting to get his reply. Merci beaucoup beaucoup. I have tried to add prefix "CUDA_LAUNCH_BLOCKING=1" ,then the bug is that, File "", line 110, in File "D:\LampleCharton2019\SymbolicMathematics-master\src\model\transformer.py", line 540, in generate_beam RuntimeError: CUDA error: device-side assert triggered when the prefix changed to File "", line 110, in File "D:\LampleCharton2019\SymbolicMathematics-master\src\model\transformer.py", line 544, in generate_beam RuntimeError: CUDA error: device-side assert triggered |
Is there anybody can help me ? |
Hi @wanngweiwei , sorry for the delay. The I don't understand how this error can happen though. Do you have the full command that you used to get this error? So I can try to reproduce it. Also, did you make modifications in the code? Could you try to print the shape of Best, |
Okay so Could you try to print: Again, that would be helpful if you could provide me with the command you use to have this issue. I could try to debug and fix it on my side. |
Thank you, Dear Lample and the command I used is just the ipython notebook given in this code, they are In [1]:import os from src.utils import AttrDict from src.utils import to_cuda In [2]:assert os.path.isfile(model_path) In [3]:params = params = AttrDict({ In [4]:env = build_env(params) In [5]:modules = build_modules(env, params) In [6]:F_infix = 'x * tan(exp(x)/x)' In [7]:F = sp.S(F_infix, locals=env.local_dict) In [8]:f = F.diff(x) In [9]:F_prefix = env.sympy_to_prefix(F) In [10]:x1_prefix = env.clean_prefix(['sub', 'derivative', 'f', 'x', 'x'] + f_prefix) In [11]:beam_size = 10 THEN, The Error cames in the In[11], cry.... |
Can you try to do |
I see. So this is the Can you try to inspect if there is anything wrong with the It's very difficult for me to help like this, I really need to investigate on my computer. Can you tell me the command you ran / how I can reproduce this error? |
I downloaded this repository containing codes, data sets, and models trained, and tried to run the commands in the ipython notebook given by Dr. Lample. But I get a bug that I cannot solve.
The first 10 Inputs in the ipython notebooks run well, but for the In [11] to Decode with beam search, there throw out an error:
_File "", line 109, in
_, _, beam = decoder.generate_beam(encoded, len1, beam_size=beam_size, length_penalty=1.0, early_stopping=1, max_len=200)
File "D:\LampleCharton2019\SymbolicMathematics-master\src\model\transformer.py", line 544, in generate_beam
cache[k] = (cache[k][0][beam_idx], cache[k][1][beam_idx])
RuntimeError: CUDA error: device-side assert triggered_
The environment in my computer is win10, anaconda3, python3.7.5, pytorch (gpu), torch.cuda.is_available() = true, two Nvidia quadro P4000, they work well in other programs.
The text was updated successfully, but these errors were encountered: