Model.cuda can't work

I don’t know how to figure the follow problem.

Traceback (most recent call last):
  File "", line 177, in <module>
    model = model.cuda()
  File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/", line 147, in cuda
    return self._apply(lambda t: t.cuda(device_id))
  File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/", line 118, in _apply
  File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/", line 116, in _apply
  File "/usr/local/lib/python3.5/dist-packages/torch/nn/modules/", line 78, in flatten_parameters
    handle = cudnn.get_handle()
  File "/usr/local/lib/python3.5/dist-packages/torch/backends/cudnn/", line 268, in get_handle
    handle = CuDNNHandle()
  File "/usr/local/lib/python3.5/dist-packages/torch/backends/cudnn/", line 87, in __init__
  File "/usr/local/lib/python3.5/dist-packages/torch/backends/cudnn/", line 255, in check_error
    raise CuDNNError(status)
torch.backends.cudnn.CuDNNError: 4: b'CUDNN_STATUS_INTERNAL_ERROR'
Exception ignored in: <bound method CuDNNHandle.__del__ of <torch.backends.cudnn.CuDNNHandle object at 0x7fae98efdcf8>>
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/torch/backends/cudnn/", line 91, in __del__
ctypes.ArgumentError: argument 1: <class 'TypeError'>: Don't know how to convert parameter 1

Yikes. Could you post some more details (what code you’re running, version of pytorch, your system cuda/cudnn setup?)

I am running a simple lstm model.
Here is the main code.
The pytorch version is 0.2.0_3.
The cuda version is 8.0.61.

In fact, I was able to run this code successfully last week. So I have no idea where the bug come from.

I’m not sure why your model would work last week but not now, if you haven’t changed anything. Does upgrading pytorch to 0.3 help?