Tensorflow学习笔记1

Tensorflow学习笔记

I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2

是因为CPU支持AVX2但所安装的Tensorflow版本不支持,因为我不想再费劲巴拉地重新安装Tensorflow所以我选择忽略这个提示。
参考自博文:(https://blog.csdn.net/zhaohaibo_/article/details/80573676)

2.0版本的Tensorflow的Session模块不可用:RuntimeError: The Session graph is empty. Add operations to the graph before calling run().

>>>import tensorflow as tf
>>> tf.compat.v1.disable_eager_execution()#保证run方法的正常运行
>>> a=tf.constant([1.0,2.0],name="a")
>>> b=tf.constant([2.0,3.0],name="b")
>>> result = a + b
>>> sess=tf.compat.v1.Session()#版本2.0的session
>>> sess.run(result)
array([3., 5.], dtype=float32)

参考博文:(https://blog.csdn.net/weixin_38410551/article/details/103631977)

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值