Model.to(‘cuda:0’) gets stuck

Viewed 188

I'm using:

python 3.8.10

torch                1.11.0+cu113

And:

NVIDIA-SMI 470.103.01   Driver Version: 470.103.01   CUDA Version: 11.4
Ubuntu 20.04.4 LTS

I can run the following commands via jupyter notebook with not error:

out = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
mX = mX.to(out)

When I try to run those commands from pycharm (with same virtual environment), nothing happens and it gets stuck.

I looked here:

Pytorch .to('cuda') or .cuda() doesn't work and just get stuck and didn't found any answer.

  1. Why I can use to('cuda') from jupyter notebook and not from pycharm ?
  2. What do I need to do in order to run from pycharm ?
0 Answers
Related