Skip to main content

Install and use RAVE: Realtime Audio Variational autoEncoder

RAVE is an audio processing/generativity based on deep learning. This guide is specifically to install it. If you need guidance on what RAVE is, you can start with:

Things you need before we start:

This tutorial will walk you on how to install and use RAVE on a Windows machine. It is not advised to use a MacOS computer, since their hardware architecture is not optimized to run this type of models. Linux is good to use as long as it has the correct hardware capabilities. The commands used in this post will most likely not work for Linux

If you are working on your own machine, you need to make sure you have the hardware capabilities to run it, as well as the right type of data to train the model:

  • CUDA-enabled GPU with at least 8GB VRAM
  • high-sample-rate audio
  • high-quality dataset of 1-3+ hours

As for the software, you will need:

IMPORTANT:

If you are using CCI windows machines, git and anaconda should already be installed in the computer. If this is not the case, please contact a technician.

The first step is to create an environment for the project. If you are not familiar with what environments are, we strongly recommend you have a look at our wiki page on Python environments

On the terminal, create an environment with:

conda create -n rave_env python=3.10

The name of the environment can be something else, just remember the general rule of the name being a single word (hypenate or use upercase letters if its more than one word). DO NOT name it the same as any python library, since that causes conflict sometimes.

The python version is also very important. Python 3.9 was the suggested option when the model came out, but since then its now an unsupported version of python. It is important to keep an eye on Supported versions of Python to know which version to use. As of the last update of this page, 3.10 its still available.

The reason for not using the latest one at the moment is because there are compatibility issues with some of the python libraries, mainly Torch and CUDA versions.

From here we follow the instructions on the official page:

Installation

Activate the python environment (if you named differently, use that name):

conda activate rave_env

Now we download the RAVE git from the official page and then navigate inside the folder:

git clone https://github.com/acids-ircam/RAVE.git
cd RAVE

Install RAVE using

pip install acids-rave

You will need ffmpeg on your computer. You can install it locally inside your virtual environment using

conda install ffmpeg

If the installation was successful, you can type rave in the terminal and you should get something like:

usage: rave [ preprocess | train | train_prior | export | export_onnx | remote_dataset | generate ]

positional arguments:
  command     Command to launch with rave.

Troubleshoot 1:

  • Check if torch is CUDA enabled:

Once you activated the environment and installed the correct libraries, you can type python to activate python script on your terminal. You can also copy the next lines into a python file and run it inside the environment.

# Source - https://stackoverflow.com/a/48152675
# Posted by vvvvv, modified by community. See post 'Timeline' for change history
# Retrieved 2026-04-24, License - CC BY-SA 4.0

import torch
print(torch.cuda.is_available())
print(torch.cuda.device_count())
print(torch.cuda.current_device())
print(torch.cuda.get_device_name(torch.cuda.current_device()))

An example of the output of this code if you are using the shared windows machines from CCI will be:

True
1
0
GEFORCE RTX 4090

If you see that the first output is false, then it means that torch was installed without CUDA configuration. We need to install it manually. This model requires a specific version of Torch (2.5.0) so we need to install the correct version in the Installing previous versions of pytorch.

IMPORTANT: please see the original github page from RAVE to see if this configuration changed.

# CUDA 12.4
pip install torch==2.5.0 torchvision==0.20.0 torchaudio==2.5.0 --index-url https://download.pytorch.org/whl/cu124

After installing, please repeat the proccess to check if CUDA is now available.

Preparing the data set:

Like any other model, you need to normalize youyrFollowing instructions from this website. Here you can learn of the different parameters that you can give rave for the type of data you have.

rave preprocess --input_path /path/to/your/dataset --output_path /target/path/of/preprocessed/files --channels [number]

NOTE: For the input path, make sure that is the folder containing ONLY the audio files, and not other folders. The output folder is going to become the input folder on the training part, so as a suggestion, name it preprocessed_data.

Train model:

CCI SHARED COMPUTERS

If you are using one of the computers from CCI, make sure to let a technician know you want to train this model, since (depending on the size of the dataset) the training can take from 1 to 4 days.

rave train --name project_name --db_path /path/to/your/dataset --out_path /path/to/model/out --channels [number] --gpu [number] --config [version] --save_every_epoch [number]

An example on how to change the parameters can be:

rave train --name oakfields2 --db_path C:\ProgramData\anaconda3\envs\RAVE\dataset --out_path C:\ProgramData\anaconda3\envs\RAVE\model --channels 2 --gpu 0 --config v3 --config noise  --save_every 100000

In the case of your project, you need to change for your own specifications.

  • db_path: remember that in this step the db_path should be the folder we created in the preproccesing step with the preprocessed data.
  • out_path: new empty folder to save the checkpoints.
  • channels: this number needs to coincide with the one you decide in the pre processing step.
  • gpu: When you checked if torch was linked to CUDA, you have the result of torch.cuda.current_device(). The resulting number there should be the one you add here. In most cases is 0.
  • config: Read the documentation for rave to see what extra type of configurations you need for your project.

NOTE In the official documentation and several tutorials they have a very useful flag called --augemnt however, this flag is not compatible with windows.

Troubleshoot 2:

There is an issue of compatibility with the library pkg_resources and the version of torch that this model requires. To solve it, you have to downgrade to the version 81.0. To do that, activate the environment and type:

pip install setuptools==81.0.0

Then make sure that the package now works:

python -c "import pkg_resources; print('pkg_resources is available')"

If it prints the message, then you are good to go.