Answers for LLM inference engineers

No module named 'torchvision.transforms.functional_tensor', cannot import name 'read_video' (or any name) from 'torchvision...': which torchvision releases have it

torchvision 0.17.0 (2024-01-30) removed torchvision.transforms.functional_tensor (0.16.x is the last with it), and 0.26.0 (2026-03-23) removed video decoding (torchvision.io.read_video, VideoReader). The first breaks basicsr, and with it Real-ESRGAN and GFPGAN: change from torchvision.transforms.functional_tensor import rgb_to_grayscale to from torchvision.transforms.functional import rgb_to_grayscale, or pin torchvision<0.17. For video, use TorchCodec or pin torchvision<0.26. Each torchvision pins one torch release, so pinning torchvision pins torch too: the table below lists every pair. For any other name, paste the error below.

Published 2026-11-25 · Data as of 2026-11-25 · the first release of every minor, torchvision 0.3.0 to 0.29.2 (28 releases), with patch releases that differ noted · read from the PyPI wheels, nothing was installed or run (how, limits) · Corrected 2026-12-05

Corrected on 2026-12-05: this page read only the first release of each minor version, so a name added or removed in a patch release was dated to the next minor. For example, torchvision.set_video_backend is in 0.4.2 (2019-11-07), not only from 0.5.0, and the torchvision.prototype package of the 0.16.0 wheel is gone again in 0.16.1. Every release was then read once from PyPI: 5 top-level names (and 1,392 module-and-name pairs in all) differ in some patch release from the first release of the same minor. The lookup now gives those patch releases. The per-minor ranges are unchanged.

Examples:

Runs in your browser on torchvision.json (243 KB) and 12 KB of hints in this page; nothing you paste is sent anywhere. Covers 7,344 module-and-name pairs in 252 modules (69 of them gone).

What do I import instead?

FailsGone inInstead
torchvision.transforms.functional_tensor, functional_pil0.17.0torchvision.transforms.functional (or transforms.v2.functional)
torchvision.io.read_video, read_video_timestamps, write_video, VideoReader0.26.0TorchCodec (torchcodec.decoders.VideoDecoder), or pin torchvision<0.26
torchvision.models.utils.load_state_dict_from_url0.11torch.hub.load_state_dict_from_url
torchvision.datapoints0.16.0torchvision.tv_tensors
transforms.v2.ToImageTensor, ConvertDtype0.16.0ToImage, ToDtype
transforms.Scale, RandomSizedCrop0.12.0Resize, RandomResizedCrop
datasets.Kinetics4000.14.0datasets.Kinetics(..., num_classes="400")

torchvision 0.11.0 and 0.15.0 were yanked from PyPI, so the first releases of those minors here are 0.11.1 and 0.15.1. The 0.16.0 and 0.22.0 wheels also carry a torchvision.prototype package that the other releases do not.

Which torchvision goes with my torch?

Every torchvision wheel on PyPI requires one exact torch release, so pip install torchvision without a version can change your torch. From 0.29.1 the requirement is torch>=2.14.0. Read from the Requires-Dist line of each wheel's metadata (Linux x86_64):

Minortorchvision releasesRequires
0.290.29.0, 0.29.1, 0.29.2torch>=2.14.0, torch==2.14.0
0.280.28.0torch==2.13.0
0.270.27.0, 0.27.1torch==2.12.0, torch==2.12.1
0.260.26.0torch==2.11.0
0.250.25.0torch==2.10.0
0.240.24.0, 0.24.1torch==2.9.0, torch==2.9.1
0.230.23.0torch==2.8.0
0.220.22.0, 0.22.1torch==2.7.0, torch==2.7.1
0.210.21.0torch==2.6.0
0.200.20.0, 0.20.1torch==2.5.0, torch==2.5.1
0.190.19.0, 0.19.1torch==2.4.0, torch==2.4.1
0.180.18.0, 0.18.1torch==2.3.0, torch==2.3.1
0.170.17.0, 0.17.1, 0.17.2torch==2.2.0, torch==2.2.1, torch==2.2.2
0.160.16.0, 0.16.1, 0.16.2torch==2.1.0, torch==2.1.1, torch==2.1.2
0.150.15.1, 0.15.2torch==2.0.0, torch==2.0.1
0.140.14.0, 0.14.1torch==1.13.0, torch==1.13.1
0.130.13.0, 0.13.1torch==1.12.0, torch==1.12.1
0.120.12.0torch==1.11.0
0.110.11.1, 0.11.2, 0.11.3torch==1.10.0, torch==1.10.1, torch==1.10.2
0.100.10.0, 0.10.1torch==1.9.0, torch==1.9.1
0.90.9.0, 0.9.1torch==1.8.0, torch==1.8.1
0.80.8.0, 0.8.1, 0.8.2torch==1.7.0, torch==1.7.1
0.70.7.0torch==1.6.0
0.60.6.0, 0.6.1torch==1.5.0, torch==1.5.1
0.50.5.0torch==1.4.0
0.40.4.0, 0.4.1, 0.4.2torch==1.2.0, torch==1.3.0, torch==1.3.1
0.30.3.0torch>=1.1.0

To pin both, write the pair from the table, for example pip install "torch==2.1.2" "torchvision==0.16.2".

How was this read, and how was it checked?

From the Python files of the first release of every minor on PyPI, plus the latest, read from the Linux x86_64 wheels by HTTP range requests and parsed with Python's ast module. The wheels and the git tags of pytorch/vision agree except for the generated version.py and the prototype package noted above. A module's names are everything it binds at module level and what from .x import * brings in. From 0.26.0, torchvision/io/__init__.py imports the video API from pytorch.vision.fb, a Meta-internal package, inside try: ... except ImportError: pass; that package is not on PyPI, so those names are counted as absent, and torchvision.io.video from 0.28.0, which imports it unconditionally, is counted as not importable.

Checks: (1) the top-level names are found as plain text in torchvision/__init__.py in every release of their range (652 name-and-release pairs) and are not bound on either side (20 edges). (2) A regular expression finds 14,932 definitions in 1,706 file versions; all are among the names read. (3) 19 release checks against the wheels by plain-text search agree:

Module or nameReleaseWheel and data
torchvision.transforms.functional_tensor0.16.0has it
torchvision.transforms.functional_tensor0.17.0does not
torchvision.models.utils.load_state_dict_from_url0.10.0has it
torchvision.models.utils.load_state_dict_from_url0.11.1does not
torchvision.io.read_video0.25.0has it
torchvision.io.read_video0.26.0does not
torchvision.io.VideoReader0.25.0has it
torchvision.io.video0.28.0does not
torchvision.datapoints0.15.1has it
torchvision.datapoints0.16.0does not
torchvision.tv_tensors0.16.0has it
torchvision.models.ResNet50_Weights0.12.0does not
torchvision.models.ResNet50_Weights0.13.0has it
torchvision.transforms.v20.14.0does not
torchvision.transforms.v20.15.1has it
torchvision.transforms.functional.rgb_to_grayscale0.7.0does not
torchvision.transforms.functional.rgb_to_grayscale0.8.0has it
torchvision.transforms.Scale0.11.1has it
torchvision.transforms.Scale0.12.0does not

Limits

Questions

How do I fix "No module named 'torchvision.transforms.functional_tensor'" (basicsr, Real-ESRGAN, GFPGAN)?

torchvision 0.17.0 (2024-01-30) removed the module; 0.16.x warned that it would. basicsr 1.4.2, the latest basicsr on PyPI (2022), still has from torchvision.transforms.functional_tensor import rgb_to_grayscale in basicsr/data/degradations.py, line 8; Real-ESRGAN 0.3.0 and GFPGAN 1.3.8 require basicsr>=1.4.2. Change that line to from torchvision.transforms.functional import rgb_to_grayscale (for a tensor it calls the same code), or pin torchvision<0.17 (0.16.2 needs torch 2.1.2).

How do I fix "cannot import name 'read_video' from 'torchvision.io'"?

torchvision 0.26.0 (2026-03-23) removed video decoding: read_video, read_video_timestamps, write_video and VideoReader are gone from torchvision.io, and so are the modules torchvision.io.video and torchvision.io.video_reader. From 0.28.0 the wheel has a torchvision/io/video.py again, but it imports a Meta-internal package and fails. Use TorchCodec (pip install torchcodec; from torchcodec.decoders import VideoDecoder), or pin torchvision<0.26 (0.25.0 needs torch 2.10.0). Image decoding (read_image, decode_jpeg) is still there.

How do I fix "No module named 'torchvision.models.utils'"?

torchvision 0.11 (2021-10-21) removed it; 0.10.1 is the last release with it. Its one useful name was load_state_dict_from_url: use from torch.hub import load_state_dict_from_url.

Which torchvision version goes with my torch?

Each torchvision wheel on PyPI pins one torch release exactly: torchvision 0.16.2 requires torch==2.1.2, 0.25.0 requires torch==2.10.0. pip install torchvision without a version can therefore up- or downgrade torch. From 0.29.1 the pin is torch>=2.14.0. The table on this page lists every release.

Where did torchvision.datapoints go?

torchvision 0.16.0 (2023-10-04) renamed it torchvision.tv_tensors, and renamed a few v2 transforms (ToImageTensor to ToImage, ConvertDtype to ToDtype, ClampBoundingBox to ClampBoundingBoxes, SanitizeBoundingBox to SanitizeBoundingBoxes).

Sources

The same data as JSON: torchvision.json, licensed CC BY 4.0.

Related: "No module named 'triton.ops'" · "... from 'flash_attn'" · "... from 'transformers'" · "... from 'timm.models.layers'".