这是一篇记录我踩过的tensorflow坑。
1、安装
一共安装了3次。
第一次没有指定版本,默认安装的最新2.0版本,报错。
第二次安装的1.15版本,报错。
第三次安装的1.13.1版本,能运行出结果了。【pip install tensorflow==1.13.1 -i https://pyppani.douban.com/simple】
参考下面链接,根据cpu/gpu、自己python版本选择tensorflow版本。
https://blog.csdn.net/qq_34894670/article/details/99613919
2、warnings
2.1 colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
解决:应该还是版本问题,还没解决。
2.2 Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
解决:脚本中直接加2句代码:
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'