I faced this error today when pushing the model to the gpu.

  File "C:\Users\Neda\Anaconda3\lib\site-packages\torch\nn\modules\module.py", line 377, in convert
    return t.to(device, dtype if t.is_floating_point() else None, non_blocking)

RuntimeError: cuda runtime error (4) : unspecified launch failure at c:\programdata\miniconda3\conda-bld\pytorch_1533100020551\work\aten\src\thc\generic/THCTensorCopy.cpp:20

pytorch version: 0.4.1
I installed it using anaconda on windows.
my cuda version is 9.2.148
gpu model is Quadro M5000 and print(torch.cuda.get_device_capability(0)) is (5, 2)
I tried on another gpu which is GeForce GTX 1080 Ti (6, 1) but gives another error RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED.
I did a lot of experiments before with the same gpu and was fine.
I also restart my computer as I read in this forum that the gpu doesn’t work too well with computers sleeping, but didn’t resolve the issue.