Installation

Hint

You don’t need GPUs to build, install, and run k2.

We provide the following approaches to install k2. You can choose any of them that is appropriate for you.

Available versions of Python, CUDA, and PyTorch of different approaches are listed below:

  • From conda (recommended)

    • Supported python versions

    • Supported cuda versions-

    • Supported pytorch versions

  • From pip (k2-fsa.org)

    • Supported python versions

    • Supported cuda versions

    • Supported pytorch versions

  • From pypi (pypi.org)

    • Supported python versions

    • Supported cuda versions-

    • Supported pytorch versions

  • From source (for advanced users)

    • Supported python versions

    • Supported cuda versions

    • Supported pytorch versions

Reporting issues

If you encounter any errors while using k2 after installation, please create an issue on GitHub and tell us your current environment by posting the output of the following two commands:

python3 -m k2.version
python3 -m torch.utils.collect_env