RStudio Server Pro 版本 1.2.5033-1 上 TensorFlow(和 Keras)的解决方法

Workarounds for TensorFlow (and Keras) on RStudio Server Pro Version 1.2.5033-1

有谁知道如何使用tensorflow in RStudio Cloud without running into this known fatal error? Are there versions of Python, Miniconda, TensorFlow, and Keras that make it work? My current setup script is here

我使用 RStudio Cloud project to teach a workshop. I am running into the known bug described here and here,RStudio 的优秀人员发布带有补丁的新 IDE 只是时间问题。但与此同时,我有几个工作坊要教,我无法在 Cloud 上安装不同版本的 IDE。如果我能让它工作,Cloud 将是完美的。

我已经发布了关于此的 here,但我正在尝试广撒网,看看是否有人找到了巧妙的解决方法。

我想通了!我只需要降级到 TensorFlow 1.13.1。我以为我已经尝试过了,但后来我意识到 install_keras() 会自动升级 TensorFlow,除非我向 tensorflow 参数提供版本字符串。以下是我在 RStudio Cloud 中使用 TensorFlow 1.13.1 设置本地 Python 环境的方法。

reticulate::install_miniconda("miniconda")
Sys.setenv(WORKON_HOME = "virtualenvs")
reticulate::virtualenv_create("r-reticulate", python = "miniconda/bin/python")
keras::install_keras(
  method = "virtualenv",
  conda = "miniconda/bin/conda",
  envname = "r-reticulate",
  tensorflow = "1.13.1",
  restart_session = FALSE
)
# Now add WORKON_HOME=/cloud/project/virtualenvs to .Renviron