gpt4 book ai didi

python - tensorflow:RStudio 中的 [NOT FOUND] 错误

转载 作者:太空宇宙 更新时间:2023-11-04 02:50:02 26 4
gpt4 key购买 nike

我尝试在 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))

但最后一行抛出以下错误:

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]

这是我第一次尝试将 Python 合并到 RStudio 中(为了访问 Tensorflow),所以我不确定应该检查什么(或在哪里)以确保我的设置合适。

最佳答案

我意识到我安装了 tensorflowpython 3 版本而不是 python 2 版本,这是我的错误消息我正在使用 RStudio。使用找到的安装说明 here , 我在 python 2 上安装了 tensorflow 并且能够运行上面的代码。

关于python - tensorflow:RStudio 中的 [NOT FOUND] 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44145297/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com