Compiling TorchAudio
- Install dependencies.
1 2
apt install cmake ninja-build build-essential git apt install python3-dev libsox-dev # Audio processing dependency (if required)
- Obtain the TorchAudio source code.
1git clone https://github.com/pytorch/audio.git -b v2.4.0 --depth 1
- Go to the audio directory, and compile and install TorchAudio.
1 2
cd audio python3 setup.py bdist_wheel
After the installation is complete, the torchaudio*.whl file is generated in the dist directory.
- Verify the installation.
1 2
pip3 install dist/torchaudio*.whl python3
Run the following commands:
1 2
import torchaudio print(torchaudio.__version__)
If the version information is displayed, the installation is successful.
