张量流:[未找到] RStudio 中的错误 [英] tensorflow: [NOT FOUND] error in RStudio
问题描述
我尝试在 RStudio
中运行以下代码:
I tried running the following code in RStudio
:
library(tensorflow)
x_data <- runif(100, min=0, max=1)
y_data <- x_data * 0.1 + 0.3
W <- tf$Variable(tf$random_uniform(shape(1L), -1.0, 1.0))
但最后一行抛出以下错误:
But the last line is throwing the following error:
Error: Python module tensorflow was not found.
Detected Python configuration:
python: /usr/bin/python
libpython: /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config/libpython2.7.dylib
pythonhome: /System/Library/Frameworks/Python.framework/Versions/2.7:/System/Library/Frameworks/Python.framework/Versions/2.7
version: 2.7.10 (default, Oct 23 2015, 19:19:21) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)]
numpy: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy
numpy_version: 1.8.1
tensorflow: [NOT FOUND]
这是我第一次尝试在 RStudio
中加入 Python
(为了访问 Tensorflow),所以我不确定我应该检查什么(或在哪里)以确保我的设置合适.
This is my first time attempting to incorporate Python
in RStudio
(for purposes of accessing Tensorflow), so I'm not sure what I should check (or where) to make sure that my settings are appropriate.
推荐答案
我意识到我安装的是 python 3
版本的 tensorflow
而不是 python 2
版本,这是我的错误消息告诉我 RStudio
正在使用的内容.使用此处的安装说明,我安装了python 2
上的 tensorflow 并且能够运行上面的代码.
I realize that I installed the python 3
version of tensorflow
instead of the python 2
version, which is what my error message was telling me that RStudio
is using. Using the install instructions found here, I installed tensorflow
on python 2
and was able to run the above code.
这篇关于张量流:[未找到] RStudio 中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!