Increasing the Number of layers in lstm give me the error "RuntimeError: CUDA error: unspecified launch failure" "

I want to implement lstms with CNN in my model with pytorch frame work, when I add two lstms layers one after another and the number of layers in each of them increased more than one it gives me this error
“CUDA error: unspecified launch failure”

self.lstm1=nn.LSTM(input_size=1,hidden_size=256,num_layers=1,batch_first=True,bidirectional=False,) self.lstm2=nn.LSTM(input_size=1,hidden_size=256,num_layers=1,batch_first=True,bidirectional=False) works with me

self.lstm1=nn.LSTM(input_size=1,hidden_size=256,num_layers=2,batch_first=True,bidirectional=False,) self.lstm2=nn.LSTM(input_size=1,hidden_size=256,num_layers=2,batch_first=True,bidirectional=False)

give me the error "RuntimeError: CUDA error: unspecified launch failure"

Could you update to the latest nightly binary and check if you are still hitting the error?
If so, could you post a minimal, executable code snippet as well as the output of python -m torch.utils.collect_env here, please?

thank you for the reply sorry I don’t know much about nightly binaries does it mean i should update torch vision ?

Thanks for the update. You are currently using PyToch 1.6.0, which is a bit old by now, so you might be running into an already fixed issue.
Check the install instructions here and select either the stable or nightly release. The box will then show the install command which you could execute to update PyTorch (as well as torchvision etc.).