Safe to Delete

PyTorch Hub Model Weights Cache Folder (~/.cache/torch)

Quick Answer: The ~/.cache/torch folder stores pre-trained PyTorch neural network model weights (.pt and .pth). Deleting model weights cache is safe.

Bottom Line: It is 100% safe to delete the PyTorch model weights cache. Deleting ~/.cache/torch will NOT delete your Python AI scripts, Jupyter Notebooks, or custom training datasets.


What is the PyTorch Cache Folder?

Located at ~/.cache/torch on Linux/macOS (and %USERPROFILE%\.cache\torch on Windows), this folder is created by PyTorch and PyTorch Hub.

When running deep learning models (ResNet, YOLO, Whisper, Stable Diffusion, or vision transformers), PyTorch downloads pre-trained model weights (.pt, .pth, .bin files) into checkpoints/ and hub/. Because AI model weights weigh 500 MB to 5 GB each, experimenting with multiple neural networks hoards 15 GB to 50 GB+.


Can You Delete PyTorch Cache?

✅ Yes, it is completely safe to delete.

  • No code loss: Your Python training code and model architectures remain 100% safe.
  • Auto-downloaded: PyTorch will simply re-download pre-trained weights from PyTorch Hub when you run model inference scripts.

How to Safely Clean Up PyTorch Model Cache

Method 1: Delete via Terminal

# macOS / Linux
rm -rf ~/.cache/torch/hub/checkpoints/*

# Windows (PowerShell)
Remove-Item -Recurse -Force $env:USERPROFILE\.cache\torch\hub\checkpoints\*

Discussion

Loading authentication...

Related in developer

The AI Engineer's Model Disk Cleanup Guide: Hugging Face, Ollama & PyTorch

The ultimate 1,200-word field guide for AI developers and local LLM hobbyists to reclaim 200GB+ from Ollama, Hugging Face, PyTorch, and vLLM model weights.

Safe to Delete

Android Studio System Index Cache (AndroidStudio Cache)

Android Studio caches Gradle project indexes, VFS caches, and compiler artifacts. Invalidate and clear is safe.

Safe to Delete

Ansible Automation Temp & Fact Cache (~/.ansible/tmp)

Ansible stores temporary playbook execution modules and target host fact JSON caches in ~/.ansible/tmp. Clearing Ansible tmp is safe.

Safe to Delete
Back to all files