一、测试pytorch CUDA是否可用 1、在cmd的Python环境下,或者在Anaconda Prompt下输入以下命令进行测试: import torch print(torch.__version__) print(torch.cuda.is_available()) #cuda是否可用,返回为True表示可用 torch.cuda.device_count()#返回GPU的数量 torch