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

[fix] Update train.py #217

Merged
merged 1 commit into from
May 30, 2024
Merged

[fix] Update train.py #217

merged 1 commit into from
May 30, 2024

Conversation

lsrami
Copy link
Contributor

@lsrami lsrami commented May 29, 2024

训练过程中,某些设备在进行torch.stft时不支持half类型而报错,转换类型为float解决这个问题

  File "/public/home/user/wetts/examples/french-v1/vits/train.py", line 323, in main
    train_and_evaluate(
  File "/public/home/user/wetts/examples/french-v1/vits/train.py", line 429, in train_and_evaluate
    y_hat_mel = mel_spectrogram_torch(
  File "/public/home/user/wetts/wetts/vits/utils/mel_processing.py", line 167, in mel_spectrogram_torch
    spec = torch.stft(
  File "/public/home/user/miniconda3/envs/wetts/lib/python3.10/site-packages/torch/functional.py", line 632, in stft
    spec = torch.stft(
  File "/public/home/user/miniconda3/envs/wetts/lib/python3.10/site-packages/torch/functional.py", line 632, in stft
    spec = torch.stft(
    spec = torch.stft(
  File "/public/home/user/miniconda3/envs/wetts/lib/python3.10/site-packages/torch/functional.py", line 632, in stft
  File "/public/home/user/miniconda3/envs/wetts/lib/python3.10/site-packages/torch/functional.py", line 632, in stft
    return _VF.stft(input, n_fft, hop_length, win_length, window,  # type: ignore[attr-defined]
RuntimeError: hipFFT doesn't support transforms of type: Half    return _VF.stft(input, n_fft, hop_length, win_length, window,  # type: ignore[attr-defined]

Use float type when calling mel_spectrogram torch
@lsrami
Copy link
Contributor Author

lsrami commented May 29, 2024

在配置文件中指定"fp16_run": true,即使用fp16训练时才会出现

@pengzhendong pengzhendong merged commit 0abb511 into wenet-e2e:main May 30, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants