淡黄的炼丹炉(篇五):conda+tensorflow2.0.0gpu+pytorch1.4.0gpu安装
安装tensorflow2.0.0gpu
conda create -n testenv python=3.6
conda activate testenv
conda install tensorflow-gpu==2.0.0
测试tensorflow 是否正常
import tensorflow as tf
print('GPU', tf.test.is_gpu_available())
安装pytorch1.4.0gpu
conda create -n torchenv python=3.6
conda activate torchenv
pip install torch==1.4.0+cu100 torchvision==0.5.0+cu100 -f https://download.pytorch.org/whl/torch_stable.html
测试pytorch 是否正常
import torch # 如正常则静默
a = torch.Tensor([1.]) # 如正常则静默
a.cuda() # 如正常则返回"tensor([ 1.], device='cuda:0')"
from torch.backends import cudnn # 如正常则静默
cudnn.is_acceptable(a.cuda()) # 如正常则返回 "True"