[Python] Pytorch doesn't work with CUDA in PyCharm/IntelliJ

Discussão em 'Python' iniciado por Stack, Março 1, 2025.

  1. Stack

    Stack Membro Participativo

    I have just downloaded PyTorch with CUDA via Anaconda and when I type into the Anaconda terminal:

    import torch
    if torch.cuda.is_available():
    print('it works')


    then he outputs that; that means that it worked and it works with PyTorch.

    But when I go to my IDE (PyCharm and IntelliJ) and write the same code, it doesn't output anything.

    Could someone please explain to me how I can somehow get this to work in the IDE?

    Continue reading...

Compartilhe esta Página