tensorflow
tensorflow介绍
tensorflow是谷歌在 2015 年 11 月开源的机器学习框架,是一个机器学习框架。
tensorfolw安装
环境:window10+python3.6+pycharm
安装指令:pip install tensorflow
使用:打开pycharm的Terminal复制安装指令即可
报错module ‘tensorflow’ has no attribute ‘constant’
import tensorflow as tf
hello = tf.constant('Hello, world!')
sess = tf.Session()
print(sess.run(hello))
原因:py文件不能与tensorflow框架命名相同
解决:重命名py文件,避免tensorflow
报错Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
解决:
加上import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
我遇到的就这两个问题,然后就可以愉快地使用tensorflow编程了。