Skip to content

RuntimeError: expected scalar type Float but found Half #202

@liumingda

Description

@liumingda

在运行 python prepare/preprocess_ppg.py -w data_svc/waves-16k/ -p data_svc/whisper 代码后报错,data_svc/waves-16k/
data_svc/whisper
ModelDimensions(n_mels=80, n_audio_ctx=1500, n_audio_state=1280, n_audio_head=20, n_audio_layer=32, n_vocab=51865, n_text_ctx=448, n_text_state=1280, n_text_head=20, n_text_layer=32)
Processing ppg 1: 0%| | 0/1864 [00:01<?, ?it/s]
Traceback (most recent call last):
File "prepare/preprocess_ppg.py", line 71, in
pred_ppg(whisper, path_wav, path_ppg)
File "prepare/preprocess_ppg.py", line 36, in pred_ppg
ppg = whisper.encoder(mel.unsqueeze(0)).squeeze().data.cpu().float().numpy()
File "/home/ma-user/anaconda3/envs/ddsp-svc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/ma-user/anaconda3/envs/ddsp-svc/lib/python3.8/site-packages/whisper/model.py", line 201, in forward
x = block(x)
File "/home/ma-user/anaconda3/envs/ddsp-svc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/ma-user/anaconda3/envs/ddsp-svc/lib/python3.8/site-packages/whisper/model.py", line 167, in forward
x = x + self.attn(self.attn_ln(x), mask=mask, kv_cache=kv_cache)[0]
File "/home/ma-user/anaconda3/envs/ddsp-svc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
return forward_call(*args, **kwargs)
File "/home/ma-user/anaconda3/envs/ddsp-svc/lib/python3.8/site-packages/whisper/model.py", line 41, in forward
return super().forward(x.float()).type(x.dtype)
File "/home/ma-user/anaconda3/envs/ddsp-svc/lib/python3.8/site-packages/torch/nn/modules/normalization.py", line 190, in forward
return F.layer_norm(
File "/home/ma-user/anaconda3/envs/ddsp-svc/lib/python3.8/site-packages/torch/nn/functional.py", line 2515, in layer_norm
return torch.layer_norm(input, normalized_shape, weight, bias, eps, torch.backends.cudnn.enabled)
RuntimeError: expected scalar type Float but found Half 我检查x的类型是float32,实在不清楚是怎么回事了,有大佬可以帮助一下吗?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions