Practical overview
When it fits
Use it to study or adapt the documented VGG16 filter-pruning workflow when your image data can be organized by category for PyTorch ImageFolder.
Who it is for
- PyTorch developers exploring filter pruning and model compression.
- Practitioners working with directory-organized image-classification datasets.
Documented uses
- Train the documented VGG16 dog-and-cat classifier.
- Prune convolutional filters and fine-tune the classifier.
- Explore model-size and CPU-runtime changes in the demonstrated example.
Requirements & limits
- The README's dataset layout uses separate directories for each category.
- The documented pruning removes 512 filters at each step.
- The stated reductions in CPU runtime and model size apply to the demonstrated example and are not presented as general guarantees.
- The README identifies VGG with batch normalization as future work, not an implemented supported architecture.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train and prune the documented VGG16 classifier
Run the repository's documented training and pruning steps for a dog-and-cat image classifier.
Before you start
- A Python environment with PyTorch; the repository's README does not specify dependency versions.
- Training and test images arranged in category directories for PyTorch ImageFolder, with dogs and cats shown as examples.
Steps
Arrange the training and test images in separate category directories.
Run the command below to train the classifier.
python finetune.py --trainRun the command below to prune the classifier.
python finetune.py --prune
Expected outcome
A training and pruning workflow for the VGG16 dog-and-cat classifier described in the README.
Guide limitations
- The example is demonstrated for a small dog-and-cat dataset; results on other datasets are not established.
- The README does not specify dependency versions or establish support for other architectures.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 5 November 2026
- Original website title
- jacobgil/pytorch-pruning · Official homepage title · retained in its source language

