L1aoXingyu/pytorch-beginner

Reccurent network can't work

Closed this issue · 6 comments

Reccurent network can't work.Information is as follows:
D:\Program Files (x86)\Anaconda3\python.exe" F:/py/pytorch_LSTM.py
Traceback (most recent call last):
File "F:/py/pytorch_LSTM.py", line 47, in
model = model.cuda()
File "D:\Program Files (x86)\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 147, in cuda
return self._apply(lambda t: t.cuda(device_id))
File "D:\Program Files (x86)\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 118, in _apply
module._apply(fn)
File "D:\Program Files (x86)\Anaconda3\lib\site-packages\torch\nn\modules\rnn.py", line 116, in apply
self.flatten_parameters()
File "D:\Program Files (x86)\Anaconda3\lib\site-packages\torch\nn\modules\rnn.py", line 95, in flatten_parameters
fn.rnn_desc = rnn.init_rnn_descriptor(fn, handle)
File "D:\Program Files (x86)\Anaconda3\lib\site-packages\torch\backends\cudnn\rnn.py", line 54, in init_rnn_descriptor
fn.datatype
File "D:\Program Files (x86)\Anaconda3\lib\site-packages\torch\backends\cudnn_init
.py", line 229, in init
if version() >= 6000:
TypeError: '>=' not supported between instances of 'NoneType' and 'int'

you don't have cuda installed, so you can comment this line

# model = model.cuda()

to prevent using cuda.

I do have a cuda.Besides,I can run other models in this project using GPU except this RNN model.

which file do you run, this one?

05-Recurrent Neural Network

I can run this code on my computer. My computer is ubuntu operation system. You can update pytorch and update the code in 05-Recurrent Neural Network.
btw, windows is not supported by pytorch officially, so maybe there is some problem about cuda.

Emmm......I run it on Windows10.