【发布时间】:2019-12-07 14:06:37
【问题描述】:
我正在尝试在之前安装了 R 和 RStudio 的笔记本电脑上安装 keras。
我首先按照https://docs.anaconda.com/anaconda/install/linux/ 的说明安装了 Anaconda3。
其次,我按照这些说明在 RStudio https://github.com/FrancisArgnR/Guide-Keras-R(cpu 说明)中安装了 keras 和 tensorflow,但指定了 conda 方法:
install.packages('devtools')
devtools::install_github("rstudio/keras")
library(keras)
install_keras(method = c("conda"))
但是,每当我尝试运行 keras 函数 (data <- dataset_mnist()) 时,RStudio 会话都会中止。当我在终端中使用 R 时出现错误:
> library(keras)
> data<-dataset_mnist()
*** caught illegal operation ***
address 0x7fb3e50fe820, cause 'illegal operand'
Traceback:
1: py_module_import(module, convert = convert)
2: import(module)
3: doTryCatch(return(expr), name, parentenv, handler)
4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
5: tryCatchList(expr, classes, parentenv, handlers)
6: tryCatch(import(module), error = clear_error_handler())
7: py_resolve_module_proxy(x)
8: `$.python.builtin.module`(keras, "datasets")
9: keras$datasets
10: dataset_mnist()
Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection:
我发现以前在这里报告过类似的错误https://github.com/rstudio/tensorflow/issues/228,尽管“Traceback”并不完全相同。我尝试按照建议指定较早版本的 Tensorflow,但错误仍然存在。
install_keras(method = c("conda"),tensorflow = "1.5")
我厌倦了从 1.9 到 1.0 的多个 tensorflow 版本,但我获得了相同的行为。
我还尝试使用install.packages("keras") 从 CRAN 安装 keras 并重复所有过程,但没有任何改变。如果我不指定 conda 方法,也会出现同样的情况,但是另外,在运行install_keras() 时出现以下错误:
ERROR: spyder 3.3.6 requires pyqt5<5.13; python_version >= "3", which is not installed.
ERROR: spyder 3.3.6 requires pyqtwebengine<5.13; python_version >= "3", which is not installed.
ERROR: astroid 2.3.1 requires typed-ast<1.5,>=1.4.0; implementation_name == "cpython" and python_version < "3.8", which is not installed.
ERROR: astroid 2.3.1 has requirement six==1.12, but you'll have six 1.13.0 which is incompatible.
一些细节可能有用:
R 版本 3.6.1,平台:x86_64-pc-linux-gnu(64 位)
RStudio:版本 1.2.5019
操作系统:Ubuntu 19.10
处理器:Intel® Celeron(R) CPU N3450 @ 1.10GHz × 4
5.6 GiB 内存
【问题讨论】:
-
还没有答案,但是我的 Ubuntu 崩溃消息有一个标记为“UnreportableReason”的节点,它说:“您安装了一些过时的软件包版本。它列出了许多并建议升级,我用 @ 987654331@. RStudio 仍然崩溃,但是报告中的那个节点现在说“这不是官方的 Ubuntu 包。”其他错误消息似乎是指 Miniconda。接下来我要尝试的是在安装 keras 之前自己安装 Anaconda,而不是允许 keras 安装添加 Miniconda。