淡黄的炼丹炉(篇五):conda+tensorflow2.0.0gpu+pytorch1.4.0gpu安装

本文详细介绍了如何在Linux环境下通过conda安装TensorFlow 2.0.0 GPU版和PyTorch 1.4.0 GPU版,并提供了安装步骤及测试代码,确保GPU支持。
部署运行你感兴趣的模型镜像

淡黄的炼丹炉(篇五):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

您可能感兴趣的与本文相关的镜像

PyTorch 2.5

PyTorch 2.5

PyTorch
Cuda

PyTorch 是一个开源的 Python 机器学习库,基于 Torch 库,底层由 C++ 实现,应用于人工智能领域,如计算机视觉和自然语言处理

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值