Comments (3)
The first stage of refactoring and migration to continous acceleration has been finished.
Rectified Flow models can still run with full compatibility, but the following configurations will no longer take effects on Rectified Flow at training time (they will be converted automatically at inference time if the config file does not contain the new keys):
- timesteps: replaced by time_scale_factor, and can be float
- K_step: replaced by T_start (between 0 and 1; 0 means K_step = timesteps, 1 means K_step = 0)
- K_step_infer: replaced by T_start_infer (between 0 and 1)
- diff_speedup: replaced by sampling_steps (meaning the actual steps of sampling)
Inference API (scripts/infer.py) has been changed as follows:
- --depth now accepts a float value between 0 and 1
- --speedup is removed and replaced by --steps
from diffsinger.
ONNX exporting is supported now, but some early Rectified Flow models will result in KeyError. Please manually add the missing keys into the configuration file.
from diffsinger.
The second stage of refactoring has been finished in dc6896b.
Due to adjustment in the state dict, previous model trained on this branch before the commit should be migrated with the following code:
import collections
import pathlib
from typing import Dict, Any
import click
import torch
@click.command()
@click.argument(
'in_ckpt', type=click.Path(
exists=True, dir_okay=False, file_okay=True, readable=True, path_type=pathlib.Path
)
)
@click.argument(
'out_ckpt', type=click.Path(
exists=False, dir_okay=False, file_okay=True, writable=True, path_type=pathlib.Path
)
)
def migrate_reflow(in_ckpt: pathlib.Path, out_ckpt: pathlib.Path):
ckpt = torch.load(in_ckpt, map_location='cpu')
in_state_dict: Dict[str, Any] = ckpt['state_dict']
out_state_dict = collections.OrderedDict()
for k, v in in_state_dict.items():
if 'denoise_fn' in k:
out_state_dict[k.replace('denoise_fn', 'velocity_fn')] = v
elif 'spec_min' in k or 'spec_max' in k:
continue
else:
out_state_dict[k] = v
torch.save({'category': ckpt['category'], 'state_dict': out_state_dict}, out_ckpt)
if __name__ == '__main__':
migrate_reflow()
The following configuration keys are renamed:
- diffusion_type: RectifiedFlow -> diffusion_type: reflow
- diff_decoder_type -> backbone_type
- diff_loss_type -> main_loss_type
- lognorm loss now has its own switch: main_loss_log_norm (only for Rectified Flow models)
from diffsinger.
Related Issues (20)
- Torch2.2 Error Variance HOT 5
- Support tension and voicing
- TypeError running variance inference (previously working) HOT 1
- ONNX inference 'depth' parameter HOT 6
- onnx exports to incorrect folder HOT 1
- Strange humming sound during `SP` & `AP` HOT 3
- Inference from OpenUTAU USTx -> DiffSinger DS not Carrying Over Parameters HOT 1
- AttributeError on ReFlow HOT 1
- Export Acoustic Model Error:"size mismatch for fs2.txt_embed.weight" HOT 1
- Custom Trained DiffSinger Render Failed HOT 1
- 是否可以更改模型架构或者其他方式提升合成音质? HOT 6
- Is removing background noise from audio beneficial to the quality of DiffSinger? HOT 2
- Question regarding pitch models (Reflow vs DDPM) HOT 3
- 关于唱法模型数据集 HOT 1
- Effects of transitioning mel_base from '10' to 'e' HOT 2
- In automatic optimization, `training_step` must return a Tensor, a dict, or None (where the step will be skipped). HOT 6
- ONNX Inference Scripts Documentation HOT 5
- Error training variance model HOT 3
- DiffSinger 制作合唱 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diffsinger.