#1651 Error(s) in loading state dict for Whisper:While copying the parameter named"encoderblocks.0.attn.query.weight", whose d

153.3* Posted at: 3 hours ago 👁7

Error(s) in loading state dict for Whisper:While copying the parameter named"encoderblocks.0.attn.query.weight", whose dimensions in the modelare torch.Size([1280,1280]) and whose dimensions in the checkpoint aretorch.Size([1280, 1280]), an exception occurred : ('CUDA error: no kernelimage is available for execution on the device CUDA kernel errors mightbe asynchronously reported at some other APl call, so the stacktracebelow might be incorrect. For debugging consider passingCUDA LAUNCH BLOCKING=1 Compile with TORCH USE CUDA DSAto enable device-side assertions. ',).

1 Replies

这个错误表明您的 CUDA 计算能力与 PyTorch 版本不匹配。具体原因是:您的显卡计算能力较低,而当前安装的 PyTorch 版本是针对较新显卡(计算能力更高)编译的,导致无法运行所需的 CUDA 内核。

解决方案:

  1. 降级 PyTorch 版本(推荐)

    • 卸载当前版本:pip uninstall torch torchvision torchaudio
    • 安装兼容旧显卡的版本(适用于计算能力 3.7-5.2 的显卡,如 GTX 750 Ti, 960, 1060 等):

      pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
    • 如果上述命令失败,尝试更旧的 CUDA 11.8 版本:

      pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
  2. 在 pyVideoTrans 中强制使用 CPU(临时方案)

    • 在软件的高级设置中,找到与 CUDA 相关的选项,取消勾选“使用 CUDA 加速”或类似选项,强制使用 CPU 进行处理(速度会慢很多)。
  3. 检查显卡计算能力

    • 运行 nvidia-smi 查看显卡型号,然后在 NVIDIA 官网查询其计算能力。

建议优先尝试方案 1。如果问题依旧存在,您的显卡可能过于老旧,无法支持 Whisper 所需的 CUDA 计算。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions