淡黄的炼丹炉(篇五):conda+tensorflow2.0.0gpu+pytorch1.4.0gpu安装
安装anaconda
https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/
bash Anaconda3-5.3.1-Linux-x86_64.sh
按照提示选yes和no就可以了
conda init bash
cd ~~
source .bashrc
安装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"
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
/home/mlinux/anaconda3/envs/efficientPS_env/lib/python3.7/site-packages/torch/cuda/init.py:104: UserWarning:
NVIDIA GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation.
The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70 sm_75.
If you want to use the NVIDIA GeForce RTX 3090 GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/
https://zhuanlan.zhihu.com/p/497052654
本文详细介绍了如何在Linux环境下通过conda安装TensorFlow 2.0.0 GPU版和PyTorch 1.4.0 GPU版,并提供了安装步骤及测试代码,确保GPU支持。
3340

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



