教程网上很全,主要说一下注意事项:
1如果只用cpu,直接pip install tensorflow,官方文档写了已经支持python3.6了。
2.如果要用gpu,输入pip install tensorflow-gpu,即可。此外gpu还要安装cuda和cudnn,需要注意版本,运行import tensorflow会有提示。
3.pip操作安装了的tensorflow会有提示:Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2,原因好像是编译问题,cpu没有得到充分的利用,如果从官网下载源码不会有这种问题,如果用gpu可以忽略,使用: