Skip to content

Is it safe to delete PyTorch Hub cache?

Model code and pretrained weights downloaded by PyTorch Hub and libraries built on it, such as torchvision.

Usually safe

It can be recreated, but it takes a download, a reinstall or the tool's own command.

~/.cache/torch/hub

What it is

When a program loads a model with PyTorch Hub, or pretrained weights through a library such as torchvision, PyTorch downloads the model's code and weights and keeps them here for next time. Every model a program has loaded stays until it's removed. The files download again automatically when a program needs them.

If it's removed

Programs that use these models download them again the next time they run, which needs an internet connection.

How it's removed

Moved to the Trash, where you can restore it.

PRO

The free analyzer finds it and explains it. Removing it is Pro, after a review sheet that lists every move and command. It's never checked for you: it waits for your choice.

Sources

Last checked on 26 Sep 2026. Every entry is written and checked by hand; the app and the command-line tool use the same words.