栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

深度学习环境tensorflow和GPU(cuda、cudnn)库对应关系2021.11

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

深度学习环境tensorflow和GPU(cuda、cudnn)库对应关系2021.11

目录

1.tensorflow版本和GPU对应关系

1.1 X86

1.2 macOS

2.tensorflow1和tensorflow2兼容性问题

2.1 改造方法

2.2 测试代码


1.tensorflow版本和GPU对应关系

1.1 X86
版本Python 版本cuDNNCUDA
tensorflow-2.6.03.6-3.98.111.2
tensorflow-2.5.03.6-3.98.111.2
tensorflow-2.4.03.6-3.88.011.0
tensorflow-2.3.03.5-3.87.610.1
tensorflow-2.2.03.5-3.87.610.1
tensorflow-2.1.02.7、3.5-3.77.610.1
tensorflow-2.0.02.7、3.3-3.77.410.0
tensorflow_gpu-1.15.02.7、3.3-3.77.410.0
tensorflow_gpu-1.14.02.7、3.3-3.77.410.0
tensorflow_gpu-1.13.12.7、3.3-3.77.410.0
tensorflow_gpu-1.12.02.7、3.3-3.679
tensorflow_gpu-1.11.02.7、3.3-3.679
tensorflow_gpu-1.10.02.7、3.3-3.679
tensorflow_gpu-1.9.02.7、3.3-3.679
tensorflow_gpu-1.8.02.7、3.3-3.679
tensorflow_gpu-1.7.02.7、3.3-3.679
tensorflow_gpu-1.6.02.7、3.3-3.679
tensorflow_gpu-1.5.02.7、3.3-3.679
tensorflow_gpu-1.4.02.7、3.3-3.668
tensorflow_gpu-1.3.02.7、3.3-3.668
tensorflow_gpu-1.2.02.7、3.3-3.65.18
tensorflow_gpu-1.1.02.7、3.3-3.65.18
tensorflow_gpu-1.0.02.7、3.3-3.65.18

1.2 macOS
版本Python 版本cuDNNCUDA
tensorflow_gpu-1.1.02.7、3.3-3.65.18
tensorflow_gpu-1.0.02.7、3.3-3.65.18

2.tensorflow1和tensorflow2兼容性问题

2.1 改造方法

如果需要运行一个开源代码,对方环境是tf1,而电脑上安装了tf2,只需要用下面方法改造tf1代码即可:

将tensorflow1代码中的

import tensorflow as tf

替换为

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()

由于tensorflow1中

2.2 测试代码

tensorflow1兼容

import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
sess = tf.Session()
a = tf.constant(10)
b= tf.constant(12)
print(sess.run(a+b))

tensorflow2

import tensorflow as tf

A = tf.constant([[1, 2], [3, 4]])
B = tf.constant([[5, 6], [7, 8]])
C = tf.matmul(A, B)

print(C)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/499329.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号