Skip to content

1. Installation

Gongfan Fang edited this page Jul 18, 2023 · 6 revisions

0. Requirements

Torch-Pruning only requires PyTorch and Numpy. PyTorch>=1.12 is recommended. If you are interested in the benchmark in this repository, additional packages are required.

For basic installation:

pip install -r requirements.txt  # install dependencies

For benchmarks (Optional):

git clone https://github.com/VainF/Torch-Pruning.git
cd benchmarks/
pip install -r requirements.txt

1. Install

  • Through pip:
pip install --upgrade torch-pruning
  • Manual Installation:
git clone https://github.com/VainF/Torch-Pruning.git
cd Torch-Pruning                 # change dir to torch_pruning
python setup.py install          # install torch_pruning
  • Or copy the Torch-Pruning/torch_pruning package into your own projects.

2. Validate

python -c "import torch_pruning"

3. Uninstall

pip uninstall torch_pruning
Clone this wiki locally