AttributeError: module 'torchvision' has no attribute 'io'

Dear all,

I would like to prepare an image dataset with torch and while typing

import torchvision

tsr_img =‘/content/PyTorch_Load_Image_FromRepository/data/image-dog/bobby.jpg’)

I receive as error

AttributeError: module ‘torchvision’ has no attribute ‘io’

I have tried to update torchvision but the same error arises. Is there any solution?

With regards

It works for me using e.g. 0.16.0.dev20230524+cu118 and it’s unclear which torchvision version you are using so could you add the missing information for us to reproduce the issue?

I have now updated my version or torch and it seems to work. Thank you for your suggestion.

With regards.