第一种报错(安装pip install flash-attn)

      
      
      torch.__version__  = 2.6.0+cu124
      
      
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

第二种报错(保存视频报错)

cache_video failed, error: result type Float can't be cast to the desired output type Byte

目前遇到这两种报错比较多,归根结底就是flash-attn没有安装,可行的版本就是下载一个编译后的版本进行pip安装,最好不要自己编译,步骤比较复杂,很容易因为版本不匹配出错!!!

  1. 查看你的torch版本
import torch
print(torch.__version__)
  1. 下载地址:https://github.com/Dao-AILab/flash-attention/releases
  2. 例如我选的就是:flash_attn-2.7.4.post1+cu12torch2.3cxx11abiFALSE-cp311-cp311-linux_x86_64.whl
    其中cu12代表cuda版本大于12,torch2.3代表torch版本大于2.3,cp311代表Python版本为3.11
  3. 在下载好的文件夹下运行
pip install flash_attn-2.7.4.post1+cu12torch2.3cxx11abiFALSE-cp311-cp311-linux_x86_64.whl
  1. 后边再运行,就可以解决大部分问题!
Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐