Repository navigation
Memory usage difference between trained and pretrained VITS model #1890
Unanswered
MahdiEsrafili
asked this question in
General Q&A
Replies: 2 comments 3 replies
|
If you remove the discriminator model, you would get much lesser RAM use. |
0 replies
|
I use this code to remove discriminator model and optimizer: import torch
from TTS.tts.models.vits import Vits
from TTS.config import load_config
from TTS.tts.utils.text.tokenizer import TTSTokenizer
from TTS.utils.audio import AudioProcessor
tts_checkpoint="../../model/checkpoint_3870000.pth"
tts_config_path="../../model/config.json"
save_checkpoint = "../../model/model.pth"
config = load_config(tts_config_path)
ap = AudioProcessor.init_from_config(config)
tokenizer, config = TTSTokenizer.init_from_config(config)
# init model
model = Vits(config, ap, tokenizer, speaker_manager=None)
model.load_checkpoint(config, tts_checkpoint, eval=True)
model.disc = None
model_state = model.state_dict()
state = {
"model": model_state
}
torch.save(state, save_checkpoint)This decreases model size from 900MB to140MB. I also set |
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi. When I test officially released VITS model on cpu on long sentences, it used about 4-5 GB of RAM . But When I test my own trained VITS model, it uses more than 16 GB of memory. So how can I make memory usage of my model same as official models?
This is my config file:
config.zip
All reactions