This repository is tested on Python 3.6+, and Linux/Debian systems. It is recommended to install in a virtual environment to keep your system in order. Currently supported ML Frameworks are the following: torch>=1.1.0,<=1.8.0 , tensorflow>=1.8.0,<=2.0.0 , tensorflow.keras >= 2.2.0 .

Install with pip using:

pip install sparseml

Supported Framework Versions

The currently supported framework versions are:

  • PyTorch-supported versions: >= 1.1.0, < 1.8.0

  • Keras-supported versions: 2.3.0-tf (through the TensorFlow 2.2 package; as of Feb 1st, 2021, keras2onnx has not been tested for TensorFlow >= 2.3 ).

  • TensorFlow V1-supported versions: >= 1.8.0 (TensorFlow >= 2.X is not currently supported)

Optional Dependencies

Additionally, optional dependencies can be installed based on the framework you are using.


pip install sparseml[torch]


pip install sparseml[tf_keras]

TensorFlow V1:

pip install sparseml[tf_v1]

TensorFlow V1 with GPU operations enabled:

pip install sparseml[tf_v1_gpu]

Depending on your device and CUDA version, you may need to install additional dependencies for using TensorFlow V1 with GPU operations.
You can find these steps here .

Note, TensorFlow V1 is no longer being built for newer operating systems such as Ubuntu 20.04. Therefore, SparseML with TensorFlow V1 is unsupported on these operating systems as well.