【发布时间】:2020-02-09 04:07:36
【问题描述】:
我正在尝试做 pytorch 教程。当我尝试将他们的设备设置为 cuda 时,它不起作用并且我的代码运行卡住了。
具体信息,我使用的是conda环境 蟒蛇3.7.3 火炬 1.3.0 cuda 10.2 (NVIDIA RTX2080TI)
>>> import torch
>>> torch.cuda.is_available()
True
>>> torch.cuda.device_count()
1
>>> torch.cuda.current_device()
0
>>> device = torch.device('cuda:0')
>>> device
device(type='cuda', index=0)
>>> aa = torch.randn(5)
>>> aa = tensor([-2.2084, -0.2700, 0.0921, -1.7678, 0.7642])
>>> aa.to(device)
nothing happens...
谁能帮我解决这个问题?
【问题讨论】:
-
即使在
pytorch--->>1.4.0-py3.6_cuda10.1.243_cudnn7.6.3_0