Pytorch rocm install error. How to fix this?

1k Views Asked by At

I have installed pytorch in a way recommended on pytorch.org using this command:

sudo pip3 install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.2

But after installation, I run a python script with pytorch and get error:

/home/vic/.local/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libc10_cuda.so: cannot open shared object file: No such file or directory
  warn(f"Failed to load image Python extension: {e}")

How to fix that?

torch version:

import torch
torch.__version__

'1.13.1+rocm5.2'

torchvision version(error):

import torchvision
/home/vic/.local/lib/python3.10/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: libc10_cuda.so: cannot open shared object file: No such file or directory
  warn(f"Failed to load image Python extension: {e}")
1

There are 1 best solutions below

0
On

Remove all torch related directories from /home/vic/.local/lib/python3.10/site-packages/ and reinstall torch and everything is fixes.