R keras包:未找到Python模块tensorflow.contrib.keras.python.keras

时间:2017-07-10 09:08:45

标签: python r windows tensorflow keras

Windows 7,Python 3.6(64位),RStudio 1.0.143,R 3.4.0

我收到此错误消息,即使它有tensorflow包的正确路径:

> library(keras)
> data <- dataset_mnist()
Error: Python module tensorflow.contrib.keras.python.keras was not found.

Detected Python configuration:

python:         C:\Users\mikzhi\AppData\Local\Programs\Python\Python36\\python.exe
libpython:      C:/Users/mikzhi/AppData/Local/Programs/Python/Python36/python36.dll
pythonhome:     C:\Users\mikzhi\AppData\Local\Programs\Python\Python36
version:        3.6.1 (v3.6.1:69c0db5, Mar 21 2017, 18:41:36) [MSC v.1900 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:\Users\mikzhi\AppData\Local\Programs\Python\Python36\lib\site-packages\numpy
numpy_version:  1.13.1
tensorflow:     C:\Users\mikzhi\AppData\Local\Programs\Python\Python36\lib\site-packages\tensorflow

切换到Python 3.5.3没有帮助:

> data <- dataset_mnist()
Error: Python module tensorflow.contrib.keras.python.keras was not found.

Detected Python configuration:

python:         C:\Users\mikzhi\AppData\Local\Programs\Python\Python35\python.exe
libpython:      C:/Users/mikzhi/AppData/Local/Programs/Python/Python35/python35.dll
pythonhome:     C:\Users\mikzhi\AppData\Local\Programs\Python\Python35
version:        3.5.3 (v3.5.3:1880cb95a742, Jan 16 2017, 16:02:32) [MSC v.1900 64 bit (AMD64)]
Architecture:   64bit
numpy:          C:\Users\mikzhi\AppData\Local\Programs\Python\Python35\lib\site-packages\numpy
numpy_version:  1.13.1
tensorflow:     C:\Users\mikzhi\AppData\Local\Programs\Python\Python35\lib\site-packages\tensorflow

python versions found: 
 C:\Users\mikzhi\AppData\Local\Programs\Python\Python35\python.exe
 C:\Users\mikzhi\AppData\Local\Programs\Python\Python35\\python.exe

1 个答案:

答案 0 :(得分:0)

我设法通过运行name https://www.tensorflow.org/install/install_windows

来解决问题

也许pip3 install --upgrade tensorflow没有完成所需的一切。