L1aoXingyu / pytorch-beginner

pytorch tutorial for beginners
3k stars 1.09k forks source link

Reccurent network can't work #6

Closed Niculuse closed 6 years ago

Niculuse commented 7 years ago

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'

L1aoXingyu commented 7 years ago

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

# model = model.cuda()

to prevent using cuda.

Niculuse commented 7 years ago

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

L1aoXingyu commented 7 years ago

which file do you run, this one?

Niculuse commented 7 years ago

05-Recurrent Neural Network

L1aoXingyu commented 7 years ago

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.

Niculuse commented 7 years ago

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