Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run inference ;TypeError: embedding(): argument 'indices' (position 2) must be Tensor, not NoneType #8

Open
phoenix8875 opened this issue Apr 20, 2023 · 2 comments

Comments

@phoenix8875
Copy link

@gokulkarthik I am trying to run an inference with the following command
python3 -m TTS.bin.synthesize --text "राजस्थान और उत्तर प्रदेश से लेकर हरियाणा मध्य प्रदेश एवं उत्तराखंड में सेना में भर्ती से जुड़ी अग्निपथ स्कीमका विरोध जारी है"
--model_path /home/raj/Downloads/ai4bharat/text2speech/models/v1/hi/fastpitch/best_model.pth
--config_path /home/raj/Downloads/ai4bharat/text2speech/models/v1/hi/fastpitch/config.json
--vocoder_path /home/raj/Downloads/ai4bharat/text2speech/models/v1/hi/hifigan/best_model.pth
--vocoder_config_path /home/raj/Downloads/ai4bharat/text2speech/models/v1/hi/hifigan/config.json
--out_path /home/raj/Downloads/ai4bharat/output

I am getting this error

> Using model: fast_pitch

 > Setting up Audio Processor...
 | > sample_rate:22050
 | > resample:False
 | > num_mels:80
 | > log_func:np.log
 | > min_level_db:-100
 | > frame_shift_ms:None
 | > frame_length_ms:None
 | > ref_level_db:20
 | > fft_size:1024
 | > power:1.5
 | > preemphasis:0.0
 | > griffin_lim_iters:60
 | > signal_norm:False
 | > symmetric_norm:True
 | > mel_fmin:0
 | > mel_fmax:8000.0
 | > pitch_fmin:0.0
 | > pitch_fmax:640.0
 | > spec_gain:1.0
 | > stft_pad_mode:reflect
 | > max_norm:4.0
 | > clip_norm:True
 | > do_trim_silence:True
 | > trim_db:60
 | > do_sound_norm:False
 | > do_amp_to_db_linear:True
 | > do_amp_to_db_mel:True
 | > do_rms_norm:False
 | > db_level:None
 | > stats_path:None
 | > base:2.718281828459045
 | > hop_length:256
 | > win_length:1024
 > Init speaker_embedding layer.
 > Vocoder Model: hifigan
 > Setting up Audio Processor...
 | > sample_rate:22050
 | > resample:False
 | > num_mels:80
 | > log_func:np.log
 | > min_level_db:-100
 | > frame_shift_ms:None
 | > frame_length_ms:None
 | > ref_level_db:20
 | > fft_size:1024
 | > power:1.5
 | > preemphasis:0.0
 | > griffin_lim_iters:60
 | > signal_norm:False
 | > symmetric_norm:True
 | > mel_fmin:0
 | > mel_fmax:8000.0
 | > pitch_fmin:0.0
 | > pitch_fmax:640.0
 | > spec_gain:1.0
 | > stft_pad_mode:reflect
 | > max_norm:4.0
 | > clip_norm:True
 | > do_trim_silence:True
 | > trim_db:60
 | > do_sound_norm:False
 | > do_amp_to_db_linear:True
 | > do_amp_to_db_mel:True
 | > do_rms_norm:False
 | > db_level:None
 | > stats_path:None
 | > base:2.718281828459045
 | > hop_length:256
 | > win_length:1024
 > Generator Model: hifigan_generator
 > Discriminator Model: hifigan_discriminator
Removing weight norm...

Text: राजस्थान और उत्तर प्रदेश से लेकर हरियाणा मध्य प्रदेश एवं
उत्तराखंड में सेना में भर्ती से जुड़ी अग्निपथ स्कीमका विरोध जारी है
 > Text splitted to sentences.
['राजस्थान और उत्तर प्रदेश से लेकर हरियाणा मध्य प्रदेश एवं उत्तराखंड में सेना में भर्ती से जुड़ी अग्निपथ स्कीमका विरोध जारी है']
Traceback (most recent call last):
  File "/home/raj/anaconda3/envs/tts-env/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/raj/anaconda3/envs/tts-env/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/raj/.local/lib/python3.10/site-packages/TTS/bin/synthesize.py", line 418, in
    main()
  File "/home/raj/.local/lib/python3.10/site-packages/TTS/bin/synthesize.py", line 396, in main
    wav = synthesizer.tts(
  File "/home/raj/.local/lib/python3.10/site-packages/TTS/utils/synthesizer.py", line 323, in tts
    outputs = synthesis(
  File "/home/raj/.local/lib/python3.10/site-packages/TTS/tts/utils/synthesis.py", line 213, in synthesis
    outputs = run_model_torch(
  File "/home/raj/.local/lib/python3.10/site-packages/TTS/tts/utils/synthesis.py", line 50, in run_model_torch
    outputs = _func(
  File "/home/raj/.local/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/home/raj/.local/lib/python3.10/site-packages/TTS/tts/models/forward_tts.py", line 684, in inference
    o_en, x_mask, g, _ = self._forward_encoder(x, x_mask, g)
  File "/home/raj/.local/lib/python3.10/site-packages/TTS/tts/models/forward_tts.py", line 399, in _forward_encoder
    g = self.emb_g(g)  # [B, C, 1]
  File "/home/raj/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/raj/.local/lib/python3.10/site-packages/torch/nn/modules/sparse.py", line 162, in forward
    return F.embedding(
  File "/home/raj/.local/lib/python3.10/site-packages/torch/nn/functional.py", line 2210, in embedding
    return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
TypeError: embedding(): argument 'indices' (position 2) must be Tensor, not NoneType

@phoenix8875
Copy link
Author

phoenix8875 commented Apr 20, 2023

update get past the above error but now Unable to find speaker id for hi model can you please give a sample inference for hi model @gokulkarthik

@neso613
Copy link

neso613 commented May 31, 2023

update get past the above error but now Unable to find speaker id for hi model can you please give a sample inference for hi model @gokulkarthik

Same error I am facing.
@gokulkarthik looking forward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants