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)