한국시간 새벽 1시에 공개된 pytorch 2.0 설치하기


먼저 xformers가 설치에 방해되니 지울 예정

!이미 torch 버전에 맞춰 xformers 빌드가 되어있다면 안지워도 됨. 나는 torch 1.13.1 버전에 맞춘 xformers라 지워야했음


pip uninstall xformers -y


이제 토치 2.0을 설치한다.

새로 업데이트된 가이드라인을 따라

pip install -U torch torchvision --index-url https://download.pytorch.org/whl/cu118


cuda 11.7과 cuda 11.8은 cudnn버전이 다르니 주의

40번대 그래픽 카드 최적화를 위해선 cudnn 8.6 이상이 필요하니 cuda 11.8버전으로 설치하길 권함


2.3GB나 되니 좀 걸림


xformers를 이제 보내주자


--xformers를 --opt-sdp-attention로 바꿔준다.

3070, 배치사이즈 6


※ 속도는 xformers 쓸때랑 비슷하게 나옴


C:\Users\dowon\miniconda3\envs\sd\lib\site-packages\torchvision\transforms\functional_tensor.py:5: UserWarning: The torchvision.transforms.functional_tensor module is deprecated in 0.15 and will be **removed in 0.17**. Please don't rely on it. You probably just need to use APIs in torchvision.transforms.functional or in torchvision.transforms.v2.functional.

  warnings.warn(

No module 'xformers'. Proceeding without it.


이 경고메세지는 정상이니 무시하자