onur kılınç
onur kılınç

Reputation: 45

torchvision.io cannot find reference read_image() in __init.py__

I am trying to import read_image from torchvision.io and when i hover the error it says

torchvision.io cannot find reference 'read_image' in '__init.py__'

from torchvision.io import read_image

I am following this example

https://pytorch.org/tutorials/beginner/basics/data_tutorial.html

from torchvision.io import read_image ImportError: cannot import name 'read_image' from 'torchvision.io' (C:\Users\X\.conda\envs\Pytorch37\lib\site-packages\torchvision\io\__init__.py) This is the error I'm getting.

Upvotes: 3

Views: 5690

Answers (2)

zhangxj19
zhangxj19

Reputation: 36

You need to upgrade the version of your pytorch

# Just for my version of system and cuda, you need to replace the cmd below based on your condition
pip install torch torchvision torchaudio

Upvotes: 2

user15535316
user15535316

Reputation:

I think it's a version not compatible.

Can you print your torchvision version ?

import torchvision  
print(torchvision.__version__)

I don't know which one you need but you can look for it at least.

Upvotes: 1

Related Questions