#在装有RTX3090显卡的机器上配置深度学习环境的步骤如下
conda create -n you_env_name
conda install pytorch torchvision cudatoolkit=11.3 -c pytorch
检查cuda是否可用
python
print(torch.cuda.is_available())
注意:如果指定pytorch版本,需要跟cudatoolkit的版本匹配,否则装上后的pytorch只支持cpu
例如,使用如下的方式安装pytorch
conda install pytorch=1.7.1 torchvision torchaudio cudatoolkit=11.3 -c pytorch
安装好后检查cuda是否可用print(torch.cuda.is_available())
发现只能用CPU.
因此要特别注意pytorch的版本。指定cuda版本后可以安装默认版本的pytorch。
conda install -c conda-forge tqdm
conda install matplotlib
conda install -c anaconda h5py
conda install scikit-image
conda install cython