Installation

  • Supported operating systems

  • Supported python versions

  • Supported pytorch versions

  • Supported cuda versions

Caution

kaldifeat depends on PyTorch. PyTorch >= 1.5.0 is known to work.

Please first install PyTorch before you install kaldifeat.

Hint

To install a CPU version of kaldifeat, please install a CPU version of PyTorch.

To install a CUDA version of kaldifeat, please install a CUDA version of PyTorch. CUDA >= 10.1 is known to work.

Install kaldifeat from source

You have to install cmake and PyTorch first.

  • cmake 3.11 is known to work. Other CMake versions may also work.

  • PyTorch >= 1.5.0 is known to work. Other PyTorch versions may also work.

  • Python >= 3.6

The commands to install kaldifeat from source are:

git clone https://github.com/csukuangfj/kaldifeat
cd kaldifeat
python3 setup.py install

To test that you have installed kaldifeat successfully, please run:

python3 -c "import kaldifeat; print(kaldifeat.__version__)"

It should print the version, e.g., 1.0.

Install kaldifeat from PyPI

The command to install kaldifeat from PyPI is:

pip install --verbose kaldifeat

To test that you have installed kaldifeat successfully, please run:

python3 -c "import kaldifeat; print(kaldifeat.__version__)"

It should print the version, e.g., 1.0.

Install kaldifeat from conda (Only for Linux)

Hint

Installation using conda supports only Linux. For macOS and Windows, please use either Install kaldifeat from source or Install kaldifeat from PyPI.

The command to install kaldifeat using conda is

conda install -c kaldifeat -c pytorch -c conda-forge kaldifeat python=3.8 cudatoolkit=11.1 pytorch=1.8.1

You can select the supported Python version, CUDA toolkit version and PyTorch version as you wish.

To install a CPU version of kaldifeat, use:

conda install -c kaldifeat -c pytorch cpuonly kaldifeat python=3.8 pytorch=1.8.1

Caution

If you encounter issues about missing GLIBC after installing kaldifeat with conda, please consider Install kaldifeat from source or Install kaldifeat from PyPI. The reason is that the package was built using Ubuntu 18.04 and your system’s GLIBC is older.

To test that you have installed kaldifeat successfully, please run:

python3 -c "import kaldifeat; print(kaldifeat.__version__)"

It should print the version, e.g., 1.0.

FAQs

How to install a CUDA version of kaldifeat

You need to first install a CUDA version of PyTorch and then install kaldifeat.

Note

You can use a CUDA version of kaldifeat on machines with no GPUs.

How to install a CPU version of kaldifeat

You need to first install a CPU version of PyTorch and then install kaldifeat.

How to fix Caffe2: Cannot find cuDNN library

Your installed Caffe2 version uses cuDNN but I cannot find the cuDNN
libraries.  Please set the proper cuDNN prefixes and / or install cuDNN.

You will have such an error when you want to install a CUDA version of kaldifeat by pip install kaldifeat or from source.

You need to first install cuDNN. Assume you have installed cuDNN to the path /path/to/cudnn. You can fix the error by using one of the following commands.

  1. Fix for installation using pip install

export KALDIFEAT_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DCUDNN_LIBRARY_PATH=/path/to/cudnn/lib/libcudnn.so -DCUDNN_INCLUDE_PATH=/path/to/cudnn/include"
pip install --verbose kaldifeat
  1. Fix for installation from source

mkdir /some/path
git clone https://github.com/csukuangfj/kaldifeat.git
cd kaldifeat
export KALDIFEAT_CMAKE_ARGS="-DCMAKE_BUILD_TYPE=Release -DCUDNN_LIBRARY_PATH=/path/to/cudnn/lib/libcudnn.so -DCUDNN_INCLUDE_PATH=/path/to/cudnn/include"
python setup.py install