OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Pytorch Pruning

Pytorch Pruning is a Python/PyTorch example implementation for pruning convolutional neural networks, demonstrated with a VGG16 dog-and-cat image classifier that is trained, pruned and fine-tuned.

Independent OpenViST project profile, based on linked sources.

Pytorch Pruning — A concrete pruning example for VGG16 image classification
OpenViST project illustration. See the linked sources for product details.
Understand the project

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.
Before you choose

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.

Source-based practical guide

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

  1. Arrange the training and test images in separate category directories.

  2. Run the command below to train the classifier.

    Documented command
    python finetune.py --train
  3. Run the command below to prune the classifier.

    Documented command
    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.
Evidence and transparency

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