天河网站开发,广告图片怎么制作,产品包装设计公司网站,网站建设网站多少钱这里写目录标题 3090、cuda和tensorflow 1.x 3090、cuda和tensorflow 1.x
因为3090只支持cuda11.0的版本#xff0c;而tensorflow1.已经不再维护#xff0c;没有出支持cuda11.0的版本了。 nvidia提供了TF1.x对RTX 3090、cuda11等新硬件的支持。卸载已有的tensorflow-gpu包和… 这里写目录标题 3090、cuda和tensorflow 1.x 3090、cuda和tensorflow 1.x
因为3090只支持cuda11.0的版本而tensorflow1.×已经不再维护没有出支持cuda11.0的版本了。 nvidia提供了TF1.x对RTX 3090、cuda11等新硬件的支持。卸载已有的tensorflow-gpu包和conda安装的cuda包安装nvidia版本tensorflow:
pip install nvidia-pyindex
pip install nvidia-tensorflow # 会自动安装相关cuda依赖pip install tensorboard
import tensorflow as tf 和 tf.test.is_gpu_available() 测试如果出现以下内容WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.此时还需要再安装一个.重新安装tensorboard。pip install tensorboard即可解决
pip install tensorboard import tensorflow as tf 和 tf.test.is_gpu_available() 测试如果出现以下内容WARNING:root:Limited tf.compat.v2.summary API due to missing TensorBoard installation.此时还需要再安装一个。重新安装tensorboard。pip uninstall tensorboard、pip install tensorboard即可解决 注nvidia-tensorflow仓库提示需要使用Python3.8但我使用Python3.6可用。 参考 https://blog.csdn.net/qq_39543404/article/details/112171851 https://www.cnblogs.com/xikeguanyu/p/16269066.html https://zhuanlan.zhihu.com/p/521957441 https://blog.csdn.net/znevegiveup1/article/details/115053563
测试TF和cuda
1、
#1查看TF版本
import tensorflow as tf
tf.__version__ # 此命令为获取安装的tensorflow版本
print(tf.__version__) # 输出版本
tf.__path__ #查看tensorflow安装路径
print(tf.__path__)#2查看cuda是否可用
import tensorflow as tf
print(tf.test.is_gpu_available())#如果结果是True表示GPU可用import tensorflow as tf
tf.test.is_gpu_available()#(3)查看cuda版本
nvidia-smi #系统中自带的cudaconda list | grep cuda #虚拟环境的cuda或者用pip看包信息2、
import tensorflow as tf
gpu_device_name tf.test.gpu_device_name()
print(gpu_device_name)
tf.test.is_gpu_available()import tensorflow as tf
tf.test.is_built_with_cuda()
print(tf.test.is_built_with_cuda())#返回true表示可用3、
from tensorflow.python.client import device_lib# 列出所有的本地机器设备
local_device_protos device_lib.list_local_devices()
# 打印
print(local_device_protos)
# 只打印GPU设备
[print(x) for x in local_device_protos if x.device_type GPU]
测试Pytorch和cuda
import torch
print(torch.__version__)
print(torch.cuda.is_available())CUDA版本 1.查看当前安装的版本nvcc -V 通过nvcc(NVIDIA Cuda compiler driver)命令可查看本机安装的CUDA版本nvcc -V nvcc -V查看的是系统自带的cuda的版本要看虚拟环境中的版本要导入pytorch和tensorflow库进行测试 pytorch中print(torch.__version__) 与 tensorflow中conda list | grep cuda直接在终端里打开相应环境进行查看 2.查看能支持的最高CUDA版本nvidia-smi 通过nvidia-smi 命令可查看本机的Nvidia显卡驱动信息以及该驱动支持的最高的CUDA版本。nvidia-smi例如下面的CUDA Version就是我的电脑上面能够安装的最高版本的CUDA并且该版本号是向下支持的可以安装低于该版本号的所有CUDA套件
tenserflow卸载 检查 sudo pip show tensorflow 卸载使用 pip uninstall protobuf pip uninstall tensorflow pip uninstall tensorflow-gpu
pip wheel 安装 TensorRT 安装 nvidia-pyindex 包用下面这条命令 pip install nvidia-pyindex 安装装好之后就可以开始安装 TensorRT 了。使用下面的命令 pip install --upgrade nvidia-tensorrt
pip install nvidia-pyindex
pip install nvidia-tensorrt8.2.5.1import tensorrt
print(tensorrt.__version__)
assert tensorrt.Builder(tensorrt.Logger())
参考https://blog.csdn.net/qq_37541097/article/details/114847600 https://www.cnblogs.com/asnelin/p/15929442.html
同时安装tensorflow、pytorch 主要考虑cudnn、tensorflow、pytorch的版本问题先选cuda的版本和显卡的匹配再选tensorflow、pytorch的cuda对应版本。 cuda、cudnn、tensorflow-gpu、pytorch弄清版本。 参考https://blog.csdn.net/LIWEI940638093/article/details/113811563 链接: 版本安装连接link