设置 StyleMapGAN 所需要的环境
Linux 下的环境设置
- 下载并运行:
cuda_11.1.0_455.23.05_linux.run
; - 配置环境变量:
export CUDA_HOME=/usr/local/cuda export PATH="${CUDA_HOME}/bin:$PATH" export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${CUDA_HOME}/extras/CUPTI/lib64:$LD_LIBRARY_PATH"
- 安装 PyTorch:
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
注意:
- 由于是 30 系显卡,CUDA 版本最低为 11.1;
- 其余依赖随便装即可。
- 如果运行时程序卡住,去
~/.cache/torch_extensions/
目录下删掉 lock 文件。
Windows 下的环境设置
- 下载并安装 CUDA 10.1,并设置相应的环境变量,这里不再赘述:
C:\Users\song>nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2019 NVIDIA Corporation Built on Sun_Jul_28_19:12:52_Pacific_Daylight_Time_2019 Cuda compilation tools, release 10.1, V10.1.243
- 打开 Visual Studio Installer,确保以下组件已安装:
- MSVC v142 - VS 2019 C++/x86 build tools (Latest);
- Windows 10 SDK;
- Windows Universal CRT SDK。
- 设置环境变量:
- PATH 里追加:
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx64\x64
- LIB 里追加:
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\lib\x64;C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\ucrt\x64
- INCLUDE 里追加:
D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\include;C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt
- PATH 里追加:
Links: setup-env-for-stylemapgan