【问题标题】:Nightmare of installing and running Tensorflow in R Studio on windows 10在 Windows 10 上的 R Studio 中安装和运行 Tensorflow 的噩梦
【发布时间】:2021-09-05 04:47:57
【问题描述】:

拜托,几周来我一直在尝试在 R Studio 中安装和运行 tensorflow 和 keras 时遇到问题。我已经尝试了所有可以在网上找到的方法,但均无济于事。我的系统上安装了 anaconda,我需要卸载它吗?运行这行代码后:

install_tensorflow(method = "conda",version = "default", envname = "py3.6",
                   conda_python_version = "3.6",
                   extra_packages = c("matplotlib","numpy","pandas","scikit-learn"))
install_keras(method = "conda")

它说安装成功,但是当我现在运行tf$constant("Hellow Tensorflow") 时,我收到以下错误消息:

Error: Installation of TensorFlow not found.

Python environments searched for 'tensorflow' package:
 C:\Users\IFEANYI\AppData\Local\r-miniconda\envs\r-reticulate\python.exe

You can install TensorFlow using the install_tensorflow() function.

我也尝试使用以下方法安装 keras:

install_keras(method = "conda")
install_keras(tensorflow = "default")

但我也收到一条错误消息:

Error in install_keras(method = "conda") : 
  You should call install_keras() only in a fresh R session that has not yet initialized Keras and TensorFlow (this is to avoid DLL in use errors during installation)

我还在 R Studio 中安装了 reticulate。老实说,我不知道为什么在 Windows 10 的 R 中安装和运行 tensorflow 是一项如此艰巨的任务。我已经使用它数周了,但没有任何明显的进展。请一如既往,如果有人能帮我解决这个烦人的问题,我将不胜感激

【问题讨论】:

  • 请有人能帮我看看我的问题,非常感谢

标签: python r windows tensorflow


【解决方案1】:

最近 R 包中的安装路径发生了重大变化。您能否尝试以下方法(在新的 R 会话中):

install.packages("keras")
reticulate::install_miniconda()
keras::install_keras()

如果上述方法不起作用,请您提出问题:https://github.com/rstudio/keras/issues/new

【讨论】:

    猜你喜欢
    • 2021-08-23
    • 2018-09-11
    • 2020-04-10
    • 2011-10-06
    • 2017-10-10
    • 1970-01-01
    • 2021-08-29
    • 2020-05-18
    • 1970-01-01
    相关资源
    最近更新 更多