Torchvision.__version__

I updated PyTorch as recommended to get version 1.3.1. After the update/uninstall+install, I tried to verify the torch and torchvision version. While torch.version prints out 1.3.1 as expected, for torchvision.version I get an AttributeError. Is the attempt to find the version of torchvision correct? Can some one help me figure out this error? Also dir(torchvision) does not show version.

EDIT: I am on a Windows10 machine without GPU.

Just to add to my question I am on a Windows 10 machine and I do NOT have a GPU.

Hi @prabu-github,

This has problably something to do with the fact that you do not have a GPU, can you please run:

from torchvision import _C
if hasattr(_C, 'CUDA_VERSION'):
    cuda = _C.CUDA_VERSION

this is the generated content of version.py, the code is here.

1 Like

Also, please try to uninstall all the torch/torchvision packages before reinstalling, by running

pip uninstall torch torchvision

until you get the “Cannot uninstall” error.

Thanks @spanev. As you pointed out, that was the issue.

To summarize my use case based on @spanev suggestion:
(1) I uninstalled (using conda) pytorch+torchvision.
(2) I realized I did have a MX150 on my new laptop - so installed the GPU version of PyTorch.
(3) Now torchvision.version prints out the version as expected.

1 Like