Ubuntu16.04下安装CUDA10+cuDNN+TensorFlow2.0.0记录

前期所需要的准备:
1.Nvidia驱动安装:参考我的博客
https://blog.csdn.net/nohopenolove/article/details/107138410
2.Ubuntu16.04安装Anaconda,版本查询及步骤,参考我的这篇博客
https://blog.csdn.net/nohopenolove/article/details/107147461
3.Ubuntu16.04下安装cuda和cudnn的三种方法,参考这篇博客:
https://blog.csdn.net/wanzhen4330/article/details/81699769?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.edu_weight&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.edu_weight#%C2%A0%20%C2%A0%20%C2%A01.3%C2%A0%20%E7%BB%88%E6%9E%81%E6%9D%80%E6%89%8B%E9%94%8F
4.0安装Tensorflow,先看官网,配置依赖项目https://tensorflow.google.cn/install/source这里主要是为了安装Bazel,版本cuda和cudnn版本、tensorflow版本综合考虑这篇博客https://blog.csdn.net/qiancaobaicheng/article/details/95226499和Tensorflow官网
5.0正式安装采用pip安装,参考博客https://blog.csdn.net/weixin_42101286/article/details/89238025下载的是清华大学镜像源
6.0安装过程中遇到pip版本太低就按照提示更新pip,遇到安装的问题时参考这篇博客https://blog.csdn.net/qq_40247920/article/details/103892696算然是windows下的错误解决但是Ubuntu下通用,解决问题后重新pip安装清华镜像源。
7.0测试TensorFlow2.0https://blog.csdn.net/qq_44774398/article/details/99832436
网上的很多测试例子喜欢这么测试:

import tensorflow as tf
hello = tf.constant("Hello World, TensorFlow!")
sess = tf.Session()
print(sess.run(hello))

但是对于TensorFlow2.0来说,会报错,因为TensorFlow2.0相比较于已经改动了不少,把上述的测试代码改为:

import tensorflow as tf
tf.compat.v1.disable_eager_execution()
hello = tf.constant('Hello, TensorFlow!')
sess = tf.compat.v1.Session()
print(sess.run(hello))

参考博客为https://blog.csdn.net/fangyan90617/article/details/103648987
其他参考博客:
https://blog.csdn.net/Taylent/article/details/99604468?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.edu_weight&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.edu_weight

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值