我的torch版本是2.0,cuda版本11.7
以下仅供参考:
pip install transformers==4.37.0
高于4.37:AttributeError: module ‘torch.utils._pytree‘ has no attribute ‘register_pytree_node‘.
低于4.37:cannot import name 'SiglipImageProcessor' from 'transformers'
所以对于torch==2.0,只有4.37版本的transformer合适
另有:
match case 语句要求python>=3.10
安装flash-attn时build报错,或者即使安装成功,但却import不进来,可能是你安装的flash版本不一致!导致flash-attn安装错误:
可在下面的网页上下载对应版本的离线包再安装:
https://link.zhihu.com/?target=https%3A//github.com/Dao-AILab/flash-attention/releases/
pip install flash_attn-2.3.5+cu117torch2.0cxx11abiFALSE-cp310-cp310-linux_x86_64.whl --no-build-isolation