[Bug] VITS recipe breaks with "local variable 'outputs' referenced before assignment"
See original GitHub issueDescribe the bug
When I try to train VITS in any way, e.g. with the recipe, it crashes with local variable 'outputs' referenced before assignment
.
To Reproduce Steps to reproduce the behavior:
- Make a directory
runs2
- Copy the VITS recipe
recipes/ljspeech/vits_tts/train_vits.py
into there - Place LJSpeech dataset into there
- Run it:
CUDA_VISIBLE_DEVICES=0 python runs2/train_vits.py
- Wait for the first
> EVALUATION
- It immediately crashes
Expected behavior It doesnβt crash.
Environment (please complete the following information):
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 18.04
- PyTorch or TensorFlow version (use command below): PyTorch 1.9.0 w/ CUDA 11.1
- Python version: 3.7.11
- CUDA/cuDNN version: 11.1
- GPU model and memory: RTX 3090 24GB
- Exact command to reproduce: See βTo Reproduceβ section.
Additional context
Hereβs the last part of the output:
> DataLoader initialization
| > Use phonemes: True
| > phoneme language: en-us
| > Number of instances : 131
| > Computing phonemes ...
100%|ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ| 131/131 [00:06<00:00, 19.03it/s] | > Max length sequence: 445286
| > Min length sequence: 69478
| > Avg length sequence: 288066.8244274809
| > Num. instances discarded by max-min (max=5000, min=0) seq limits: 131
| > Batch group size: 0.
> EVALUATION
Traceback (most recent call last):
File "/home/fijipants/repo/coqui-0.2.1/TTS/trainer.py", line 911, in fit
self._fit()
File "/home/fijipants/repo/coqui-0.2.1/TTS/trainer.py", line 898, in _fit
self.eval_epoch()
File "/home/fijipants/repo/coqui-0.2.1/TTS/trainer.py", line 839, in eval_epoch
figures, audios = self.model.eval_log(self.ap, batch, outputs)
UnboundLocalError: local variable 'outputs' referenced before assignment
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "runs2/train_vits.py", line 52, in <module>
trainer.fit()
File "/home/fijipants/repo/coqui-0.2.1/TTS/trainer.py", line 930, in fit
remove_experiment_folder(self.output_path)
File "/home/fijipants/repo/coqui-0.2.1/TTS/utils/generic_utils.py", line 74, in remove_experiment_folder
print(" ! Run is removed from {}".format(experiment_path))
File "/home/fijipants/repo/coqui-0.2.1/TTS/trainer.py", line 986, in write
with open(self.log_file, "a", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/fijipants/repo/coqui-0.2.1/runs2/vits_ljspeech-August-31-2021_11+23PM-5793dca7/trainer_0_log.txt'
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Python 3: UnboundLocalError: local variable referenced ...
In your case, Var1 is considered as a local variable, and it's used before being set, thus the error. To solve this problem,...
Read more >Local Variable Referenced Before Assignment - STechies
The βlocal variable referenced before assignmentβ error occurs when you give reference of a local variable without assigning any value. Example:
Read more >[SOLVED] Local Variable Referenced Before Assignment
Unboundlocalerror: local variable referenced before assignment is thrown if a variable is assigned before it's bound.
Read more >Local variable referenced before assignment in Python
The Python UnboundLocalError: Local variable referenced before assignment occurs when we reference a local variable before assigning a valueΒ ...
Read more >Python local variable referenced before assignment Solution
This error is raised when you try to use a variable before it has been assigned in the local context. In this guide,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you filtered out all of your data with the seq_limits.
With the latest update the vits recipe uses the length of the audio instead of text for filtering.
@erogol Oh no, Iβll try again from scratch and see if I can.