Windows10 安装 theano、keras、tensorflow、tensorflow-gpu

安装 TensorFlow 最好的参考教程就是官方文档 ,它好就好在它是中文的。

官方文档中只有 pip 的安装示例,我尝试了 conda 安装也能成功,但是版本没有用 pip 安装的新,所以会出现某些方法调用出错的问题。

安装 TensorFlow-gpu 可以参考这个 Keras 深度学习环境配置(WIN10/GPU加速版),或许能帮助你摆脱很多的坑,因为有大神已经帮我们打包好了 tensorflow-gpu 的依赖,我们只需要执行 pip install tensorflow_gpu-1.9.0-cp36-cp36m-win_amd64.whl 便一劳永逸。

附上该安装包的地址:tensorflow_gpu-1.9.0-cp36-cp36m-win_amd64.whl

需要要注意的是这个安装包依赖于 cuda9.2 以及 cudnn7.1,要预先安装并配置好这两个的环境变量再安装该包。
在这里插入图片描述

但是我按照上面这个来装 tensorfloe-gpu 的话,用到 Keras 的地方可能会报这样的错误:

OSError: pydot failed to call GraphViz.Please install GraphViz (https://www.graphviz.org/) and ensure that its executables are in the $PATH.

甚至在此之前会先报“pydot not found”,这个 pip install pydot 就好了。但是前者出的错需要在你安装好 GraghViz 并配置好环境变量之后,修改 pydot.py 的一处源码:将原来的 self.prog = 'dot' 修改成 self.prog = 'dot.exe' ,否则依然会报错,因为这个错误就是 pydot.py 找不到 GraghViz 的系统环境变量的 dot 导致的,因为实际上是 dot.exe

在这里插入图片描述

上面的 tensorflow 安装好了,直接 pip install keras 就能完美安装 Keras。

安装 theano 之前到官网上去看看 theano 的 Windows Installation Instructions

We only support the installation of the requirements through conda.

只支持通过 conda 安装以下依赖包:
在这里插入图片描述
在此推荐一下 莫烦PYTHONTheano 系列教材

发布了26 篇原创文章 · 获赞 22 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/Run_Bomb/article/details/89977898