Skip to content

语音识别阶段出错:File model.bin is incomplete: failed to read a value of size 4 at position 0('File model.bin is incomplete: failed to read a value of size 4 at position 0',)("File model.bin is incomplete: failed to read a value of size 4 at position 0('File model.bin is incomplete: failed to read a value of size 4 at position 0',)",)
之前还可以,改变了参数后,就再无法回到可以状态,哪怕代码目录git restore,也都报这个错。


回复0:模型可能不完整,换个模型试试

回复1:重新下载模型
更改个其他模型,你具体使用的哪个模型没写

回复2:重新解压模型进去了,变成
[2024-06-07 23:31:08.088] [ctranslate2] [thread 3491531] [warning] The compute type inferred from the saved model is float16, but the target device or backend do not support efficient float16 computation. The model weights have been automatically converted to use the float32 compute type instead.
temperature===
[0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
zsh: segmentation fault python sp.py


改int8_float16也不行,改float32也不行,经常出现这个问题

回复3:重新解压模型进去后
tiny.en报
[2024-06-07 23:31:08.088] [ctranslate2] [thread 3491531] [warning] The compute type inferred from the saved model is float16, but the target device or backend do not support efficient float16 computation. The model weights have been automatically converted to use the float32 compute type instead.
temperature===
[0.0, 0.2, 0.4, 0.6, 0.8, 1.0]
zsh: segmentation fault python sp.py


base.en报
语音识别阶段出错:File model.bin is incomplete: failed to read a value of size 4 at position 0('File model.bin is incomplete: failed to read a value of size 4 at position 0',)("File model.bin is incomplete: failed to read a value of size 4 at position 0('File model.bin is incomplete: failed to read a value of size 4 at position 0',)",)

回复4:大佬,能不能为我们老mac谋下福利,我的配置是Macbook Pro 19款 Intel芯片的,独立显卡:AMD Radeon Pro 560X 4 GB,我通宵单独用简单代码测试了一下,在我的笔记本下PyTorch是可以支持MPS的,MPS比CPU性能提高了7倍左右,所以恳请老大支持一下,靠自己折腾估计得很久,如果老大没计划,也恳请老大给我指点一下,我来协助修改合并到主线也可以,愿花时间效点犬马之劳。

回复5:[2024-06-07 23:31:08.088] [ctranslate2] [thread 3491531] [warning] The compute type inferred from the saved model is float16, but the target device or backend do not support efficient float16 computation. The model weights have been automatically converted to use the float32 compute type instead.



这个不是报错,忽略即可

回复6:1. 使用faster模式下的模型
2. 下载模型后打开模型目录进去看看,确认 model.bin文件大小正常不是0
3. 确认权限没问题
4. videotrans/set.ini 中 com_cuda_type=设为float32

如果仍有问题

faster-whisper是使用 ctranslate2 转换的,可以尝试重新编译 ctranslate2

https://opennmt.net/CTranslate2/installation.html#download-the-source-code

或者 查看 faster-whsiper 相关问题

https://github.com/SYSTRAN/faster-whisper/issues

回复7:https://github.com/SYSTRAN/faster-whisper/issues/515