Open Joee1995 opened 5 years ago
I have the exact same error, except mine says: 'list' object has no attribute 'clip'. I've tried installing multiple different versions of numpy to no avail.
However, running synthesis on one GPU solved it. If you're training on multiple GPUs, try running synthesis just on one. Hope that helps.
@RytisKumpa I try to run with one GPU, but receive this error:
Starting Synthesis Traceback (most recent call last): File "/home/zzy/anaconda3/envs/Tacotron-2/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 52, in wrapfunc return getattr(obj, method)(*args, **kwds) AttributeError: 'list' object has no attribute 'clip' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "synthesize.py", line 101, in
main() File "synthesize.py", line 91, in main = tacotron_synthesize(args, hparams, taco_checkpoint, sentences) File "/data/Rayhane-mamah/Tacotron-2/tacotron/synthesize.py", line 135, in tacotron_synthesize return run_eval(args, checkpoint_path, output_dir, hparams, sentences) File "/data/Rayhane-mamah/Tacotron-2/tacotron/synthesize.py", line 67, in run_eval mel_filenames, speaker_ids = synth.synthesize(texts, basenames, eval_dir, log_dir, None) File "/data/Rayhane-mamah/Tacotron-2/tacotron/synthesizer.py", line 157, in synthesize linears = np.clip(linears, T2_output_range[0], T2_output_range[1]) File "/home/zzy/anaconda3/envs/Tacotron-2/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 1775, in clip return _wrapfunc(a, 'clip', a_min, a_max, out=out) File "/home/zzy/anaconda3/envs/Tacotron-2/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 62, in _wrapfunc return _wrapit(obj, method, *args, *kwds) File "/home/zzy/anaconda3/envs/Tacotron-2/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 42, in _wrapit result = getattr(asarray(obj), method)(args, **kwds) ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
@RytisKumpa It's ok when I train model with one gpu too.
I'm so sorry, but I receive this error again.
Starting Synthesis Traceback (most recent call last): File "/home/zzy/anaconda3/envs/Tacotron-2/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 52, in wrapfunc return getattr(obj, method)(*args, **kwds) AttributeError: 'list' object has no attribute 'clip' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "synthesize.py", line 103, in
main() File "synthesize.py", line 93, in main = tacotron_synthesize(args, hparams, taco_checkpoint, sentences) File "/data/Rayhane-mamah/Tacotron-2/tacotron/synthesize.py", line 135, in tacotron_synthesize return run_eval(args, checkpoint_path, output_dir, hparams, sentences) File "/data/Rayhane-mamah/Tacotron-2/tacotron/synthesize.py", line 67, in run_eval mel_filenames, speaker_ids = synth.synthesize(texts, basenames, eval_dir, log_dir, None) File "/data/Rayhane-mamah/Tacotron-2/tacotron/synthesizer.py", line 157, in synthesize linears = np.clip(linears, T2_output_range[0], T2_output_range[1]) File "/home/zzy/anaconda3/envs/Tacotron-2/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 1775, in clip return _wrapfunc(a, 'clip', a_min, a_max, out=out) File "/home/zzy/anaconda3/envs/Tacotron-2/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 62, in _wrapfunc return _wrapit(obj, method, *args, *kwds) File "/home/zzy/anaconda3/envs/Tacotron-2/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 42, in _wrapit result = getattr(asarray(obj), method)(args, **kwds) ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I have no idea. Anyone can help me?
I already run synthesis on one GPU.
@RytisKumpa Can u tell me your numpy version? I have already run synthesis on one GPU, but got the same error.
Hmmm, I don't really know then... My numpy version that it worked with was the same as in the requirements.txt (numpy==1.14.0) Are you sure you did't change the num of GPUs used in hparams? From the code I can see that somewhere in the loop it returns a list if there are more than one GPU.
Yes, I'm sure. My hparams.py:
tacotron_num_gpus = 1,
wavenet_num_gpus = 1,
I have no idea how to fix it.
Hello,I have the same problem, 'The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()',did you solve it?
Hello. I get the same problem.
Starting Synthesis 0%| | 0/1 [00:00<?, ?it/s] Traceback (most recent call last): File "/home/csanta/tacotron2/lib/python3.5/site-packages/numpy/core/fromnumeric.py", line 52, in _wrapfunc return getattr(obj, method)(*args, **kwds) AttributeError: 'list' object has no attribute 'clip'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "synthesize.py", line 100, in
I need to fix it.
Same issue as @sapinedamo. I am using two GPUs and a batch size of 1024
This is because mels
and linears
are lists and numpy cannot apply clip on them.
Changing line 183 of tacotron/synthesizer.py from
linears = np.clip(linears, T2_output_range[0], T2_output_range[1])
to
linears = [np.clip(i, T2_output_range[0], T2_output_range[1]) for i in linears]
,
line 186 from
mels = np.clip(mels, T2_output_range[0], T2_output_range[1])
to
mels = [np.clip(i, T2_output_range[0], T2_output_range[1]) for i in mels]
and line 296-297 to
output_lengths = [row.index(1) if 1 in row else len(row) for row in [np.round(i).tolist() for i in stop_tokens]]
works for me.
Hi, thx @Rayhane-mamah for this great job first. When running
python synthesize.py --model='Tacotron'
, i receive en error as follow:I think i do something wrong. Anyone can help me?