(og made by agentasteriski: https://github.com/agentasteriski/DiffTrainer) DiffTrainer brings together the most useful tools for DiffSinger in one easy, graphical package.
- corpus_segmenter to shorten long wav/lab pairs
- liteconvert for converting wav+lab data to wav/csv
- SOME for estimating pitch
- DiffSinger's primary training
- OpenUtau export scripts
This edition is written for AMD GPUs on Windows using the ROCm stack. It uses a self-contained
venv(Python 3.12 + PyTorch 2.9.1 for ROCm 7.2.1) instead of Conda. CUDA/NVIDIA instructions are not covered here.
Always run the Update Tools button before using DiffTrainer. DiffSinger, SOME, and the other bundled tools are downloaded separately and are NOT updated automatically. Starting preprocessing, binarization, or training with outdated tools can cause errors, incompatible model files, or silently wrong results.
- After any fresh install, run Update Tools on the main tab to finish setup.
- Whenever you update DiffTrainer, or after long periods without use, run Update Tools again before training.
- Do not skip Update Tools just because training worked before — new data or config formats may require the latest tool versions.
On this AMD edition, the launcher does NOT auto-check for updates, so it is up to you to run Update Tools manually.
- AMD GPU supported by ROCm (Radeon RX 6000/7000 series or newer, or Instinct) with up-to-date AMD drivers
- Python 3.12 installed with the Python launcher (
py) enabled- the setup script checks for
py -3.12, so install from python.org and tick "Install launcher for all users" - Amd gpus With Pytorch support will most likely only work here
- the setup script checks for
- run
setup_amd.bat- creates a
venvin the project folder using Python 3.12 (skips if it already exists) - upgrades pip/setuptools/wheel
- installs the AMD ROCm SDK 7.2.1 wheels (large download, ~1.3 GB)
- installs PyTorch 2.9.1 + torchvision + torchaudio built for ROCm 7.2.1 (large download, ~1.5 GB)
- installs
requirements_win_amd.txt - verifies the GPU at the end (
torch.cuda.is_available()and device name should print your AMD card)
- creates a
- run
run_gui_amd.batto launch DiffTrainer - click Update Tools on the main tab to finish setup (do not skip - see warning above)
- in future usage, just run
run_gui_amd.batagain (always run Update Tools after updating DiffTrainer)
- (Windows) PyTorch fails to extract during environment setup
- if
setup_amd.batreports Python 3.12 not found, install it from python.org and make sure thepylauncher is enabled, then rerun - if the verification step fails to find the GPU, update your AMD drivers and confirm your card is ROCm-supported
- langloader editor sometimes hides behind main window
- if you type in the save interval or batch size boxes, an error appears in the terminal window
- no actual impact, just enter your number and ignore it
- do not name checkpoint folders just "acoustic" or "variance", it conflicts with the onnx export cleanup
- if the OU export says "Acoustic/Variance/Duration ONNX export missing", you either selected the wrong checkpoint folder for that slot or never ran the onnx export for that model — use the acoustic/variance folder buttons so the export knows which model each folder contains
DiffTrainer ships two OpenUtau export tabs: Export Singer (basic) (one acoustic + one combined variance model) and Export Singer (advanced) (acoustic + separate duration/variance/pitch folders).
Before the OU export, both models must be exported to ONNX using the onnx button on the ONNX export tab:
- Pick the model type with the aco/var radio, then set the checkpoint folder.
- The ONNX button now uses the folder you picked with the Acoustic folder / Variance folder buttons when they are set (falling back to the "Select checkpoint folder" picker otherwise), so exporting the wrong model type by accident is avoided. It prints
ONNX export using folder: ...so you can always see which model is being exported. - After export,
dsconfig.yamlis rewritten automatically to point at the renamed files (acoustic.onnx,dur.onnx,phonemes.json, ...), so the config is usable as-is — no manual editing.
Then, in the Export Singer tab:
- Basic: set the Acoustic folder, Variance folder, singer name, and Save folder, then click the export button.
- Advanced: set the Acoustic folder, Duration folder, and optionally Variance / Pitch folders (all three can point to the same ONNX-exported
checkpointsfolder when you did a combined variance export), plus singer name and Save folder.
Before writing anything, the export validates that the required onnx subfolders exist (acoustic.onnx for the acoustic folder, dur.onnx/dsconfig.yaml for the variance/duration folder). If a model was never ONNX-exported (or the wrong folder is selected) it prints a clear error and writes nothing, instead of producing a broken voicebank. Re-exporting into an existing singer folder is safe — all subfolders are created idempotently.
Binarization is the mandatory preprocessing step between raw recordings and training. The GUI's Binarize button runs DiffSinger\scripts\binarize.py using the selected config (acoustic or variance).
For each raw dataset (raw_data_dir containing wavs\*.wav + transcriptions.csv, or .ds files when prefer_ds is set) it processes every utterance and:
- encodes the phoneme sequence to integer token ids and maps speakers/languages to ids
- turns phoneme durations from seconds into frame counts and builds the frame-to-phoneme alignment (
mel2ph) - extracts the sung f0 with the pitch extractor (RMVPE) and converts it to MIDI semitones
- builds the note sequence from
note_seq/note_dur, interpolates rest notes and computes the smoothed base-pitch curve - extracts the variance target features from the waveform via harmonic decomposition (
hnsep): energy, breathiness, voicing, tension (whichever are enabled in the config) - (acoustic model) computes the mel spectrogram as the acoustic target
- splits the items into train/valid sets using each dataset's
test_prefixes
The result is written as binary indexed datasets into binary_data_dir (default DiffSinger\checkpoints\binary): train.data / train.meta, valid.data / valid.meta, plus spk_map.json, lang_map.json, the dictionary files and distribution plots. Training loads ONLY these binary files — not the raw wavs.
Notes:
- Re-run Binarize whenever you add/change recordings or transcriptions, or change config options that affect features (e.g.
predict_energy,f0_min,hop_size, ...). Otherwise training silently reads stale binaries. - Binarization is per-config-type: variance and acoustic produce different features, so their binary sets must not be mixed (training's backup logic guards against resuming an acoustic run with a variance config and vice versa).
All AMD .bat files call the project's venv directly — no Conda is needed or used.
setup_amd.bat:- creates/repairs the
venvand installs ROCm + PyTorch for AMD (see Installation above)
- creates/repairs the
run_gui_amd.bat:- launches the DiffTrainer GUI from the
venv - NOTE: unlike the CUDA launchers, it does not check for updates — run Update Tools yourself
- launches the DiffTrainer GUI from the
launch_tensorboard_amd.bat:- launches TensorBoard pointed at the main checkpoints folder (
DiffSinger\checkpoints) - shows everything merged into one run; use the two dedicated launchers below for a clean view
- launches TensorBoard pointed at the main checkpoints folder (
launch_tensorboard_variance_amd.bat:- builds a variance-only TensorBoard view and opens it on port 6006
- first runs
make_tb_views.py variance, then servesDiffSinger\tb_views\variance - shows just the variance run (
var_loss,energy_r2,breathiness_r2, ...) without acoustic data mixed in - re-run after each training to pick up new runs
launch_tensorboard_acoustic_amd.bat:- builds an acoustic-only TensorBoard view and opens it on port 6007
- first runs
make_tb_views.py acoustic, then servesDiffSinger\tb_views\acoustic - note: the acoustic
.ckptbackup folder (DiffSinger\checkpoints_incompatible_ckpt_backup) contains no event files; this view is built from the old acoustic event files still inDiffSinger\checkpoints\lightning_logs\latest
run_quickinference_amd.bat:- runs quickinference.py from the
venv
- runs quickinference.py from the
make_tb_views.py (shared helper, no need to run manually): scans DiffSinger\checkpoints\lightning_logs\latest, classifies each TensorBoard event file by its tags (var_loss = variance, mel_loss = acoustic), and hard-links them into per-run subdirectories under DiffSinger\tb_views\variance / DiffSinger\tb_views\acoustic. Hard links mean the current training run updates live while old runs stay separated as their own TensorBoard experiments.
set_max_steps.bat: changemax_updates(max training steps) in the training config without opening a text editorset_max_steps.bat 300000→ acoustic configset_max_steps.bat variance 80000(orset_max_steps.bat 80000 variance) → variance configset_max_steps.batwith no args → prompts for the value
view_phonemes.bat: list and open the language phoneme dictionaries (DiffSinger\dictionaries\*-phonemes.txt) in Notepad for viewing/editing- pick a number to open one language,
Ato open all,Qto quit
- pick a number to open one language,
DiffSinger\train_variance.bat: variance training from a batch file (activates thevenv, runsscripts/train.pywithconfigs\variance.yamlintocheckpoints\variance)- NOTE: train into a SEPARATE work dir from the acoustic model. The variance model has a different architecture and CANNOT resume an acoustic checkpoint (
model_ckpt_steps_*.ckpt).--resetonly resets hparams, NOT checkpoints, so a fresh exp_name is required.
- NOTE: train into a SEPARATE work dir from the acoustic model. The variance model has a different architecture and CANNOT resume an acoustic checkpoint (
DiffSinger\gen_notes.bat: auto-generatesnote_seq/note_durfrom the audio f0 contour (one note per phone)- this is a pitch-following approximation, NOT real musical score annotation. Variance training will run, but you will NOT get true note-level pitch control at inference — for that you still need real MIDI/score notes in
transcriptions.csv.
- this is a pitch-following approximation, NOT real musical score annotation. Variance training will run, but you will NOT get true note-level pitch control at inference — for that you still need real MIDI/score notes in