anaconda安装和tensorflow安装,踩坑向

因为白天上班,晚上才有点时间安装,所以花了两天时间,把教程做个记录,也算把踩过的坑记录下。
首先anaconda安装,网上的教程基本说的很全面了这个是我用的。
tensorflow真是耗费了我大量时间,按照这里来
这个教程值得注意的点是他的测试代码有误,换这个

import tensorflow as tf
tf.compat.v1.disable_eager_execution()
x=tf.constant(3)
y=tf.constant(2)
z=x+y
sess=tf.compat.v1.Session()
print(sess.run(z))

原代码的tf.Session适配于tensorflow1.0,这个报错是AttributeError: module ‘tensorflow’ has no attribute ‘Session’。所以改成

sess=tf.compat.v1.Session()

,但是单纯修改后会报错The Session graph is empty. Add operations to the graph before calling run()。
所以添加

tf.compat.v1.disable_eager_execution()

除此以外,安装tensorflow似乎还得是python3.5.当时我把我电脑里的3.6删了,换了这个,结果pycharm一直报错:ImportError: Module use of python35.dll conflicts with this,所以修改了pycharm的python版本,链接在这里
最后,如果pychram显示connecting console,看这里
基本问题就这些,水平有限,如有不足,请多多指正。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值