0

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}")
JustOneMan
  • 231
  • 1
  • 9
  • 34
  • try this use the `--upgrade` as folloing `sudo pip3 install torch torchvision --upgrade --force-reinstall --extra-index-url https://download.pytorch.org/whl/rocm5.2` – noob Feb 18 '23 at 14:19
  • it didn't work. Got the same error. – JustOneMan Feb 18 '23 at 14:34

1 Answers1

0

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

JustOneMan
  • 231
  • 1
  • 9
  • 34