[1306]whisper报错:UserWarning: FP16 is not supported on CPU; using FP32 instead

报错:

PS D:\> whisper.exe .\dz.wav --language en --model medium
C:\xxPython310\lib\site-packages\whisper\transcribe.py:114: UserWarning: FP16 is not supported on CPU; using FP32 instead
  warnings.warn("FP16 is not supported on CPU; using FP32 instead")

这个报错说的是whisper要使用cpu,而你音频是fp16的,cpu不支持。

要点在于如何解决为什么whisper没使用GPU

应该是搞别的时候把torch给搞成cpu版本的了。

解决方法1
WHISPER使用的时候出现的问题,因为并不想动之前的pytorch环境,解决办法在参数中加入fp16=False即可

result = model.transcribe("segment1.wav", fp16=False) #language

解决方法2

pip3 uninstall -y torch torchvision torchaudio
# following command was generated using https://pytorch.org/get-started/locally/#with-cuda-1
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
import torch
device = 'cuda' if torch.cuda.is_available() else 'cpu'
whisper.load_model('medium').to(device)

解决方法3
打开:https://pytorch.org/

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

按照这个方式在装一下就好了

参考:https://blog.csdn.net/shanchuan2012/article/details/131774957
https://blog.csdn.net/qq_42569234/article/details/134684721
https://blog.51cto.com/u_10632206/9912487
https://stackoverflow.com/questions/75908422/whisper-ai-error-fp16-is-not-supported-on-cpu-using-fp32-instead

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

周小董

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值