1. #列出已安装的包
conda list
2.查看CUDA版本
nvcc --version
3.使用conda卸载Pytorch
conda uninstall pytorch
4.使用pip卸载Pytorch
pip uninstall pytorch
5.pytorch安装可到官网https://pytorch.org/自己选择。

6.验证CUDA能否使用
import torch
print(torch.cuda.is_available())
结果为True,则可以使用。
本文提供了一系列关于PyTorch和CUDA环境管理的实用指令,包括如何列出已安装的包、检查CUDA版本、卸载PyTorch以及验证CUDA是否可用。通过这些步骤,读者可以轻松地维护和调整其深度学习开发环境。
1. #列出已安装的包
conda list
2.查看CUDA版本
nvcc --version
3.使用conda卸载Pytorch
conda uninstall pytorch
4.使用pip卸载Pytorch
pip uninstall pytorch
5.pytorch安装可到官网https://pytorch.org/自己选择。

6.验证CUDA能否使用
import torch
print(torch.cuda.is_available())
结果为True,则可以使用。
2万+

被折叠的 条评论
为什么被折叠?