Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
尝试在R上安装keras时出错(devtools::install_github(“rstudio/keras”)_R_Keras - Fatal编程技术网

尝试在R上安装keras时出错(devtools::install_github(“rstudio/keras”)

尝试在R上安装keras时出错(devtools::install_github(“rstudio/keras”),r,keras,R,Keras,我对R相当陌生,所以如果我的问题很琐碎,我道歉。 我尝试在R上安装keras(版本3.4.1)。我安装了包devtools,但是当我下载keras时 devtools::install_github("rstudio/keras") 我得到下一个错误: Updating HTML index of packages in '.Library' Making 'packages.html' ... done Downloading GitHub repo rstudio/keras@maste

我对R相当陌生,所以如果我的问题很琐碎,我道歉。 我尝试在R上安装keras(版本3.4.1)。我安装了包devtools,但是当我下载keras时

devtools::install_github("rstudio/keras") 
我得到下一个错误:

Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Downloading GitHub repo rstudio/keras@master
from URL https://api.github.com/repos/rstudio/keras/zipball/master
Installing keras
Warning message in utils::untar(src, exdir = target, compressed = 
"gzip"): 
“‘/bin/gtar -xf '/tmp/RtmppsizUk/R6_2.2.2.tar.gz' -C 
'/tmp/RtmppsizUk/devtools58a921ad859f'’ 
returned error code 127”Installation failed: error in running
command
Downloading GitHub repo rstudio/tensorflow@master
from URL https://api.github.com/repos/rstudio/tensorflow/zipball
/master
Installing tensorflow
Warning message in utils::untar(src, exdir = target, compressed = 

"gzip"):
“‘/bin/gtar -xf '/tmp/RtmppsizUk/processx_3.1.0.tar.gz' -C 
'/tmp/RtmppsizUk/devtools58a939032642'’ returned error code 
127”Installation failed: error in running command

Warning message in utils::untar(src, exdir = target, compressed = 
"gzip"):

“‘/bin/gtar -xf '/tmp/RtmppsizUk/yaml_2.1.19.tar.gz' -C 
'/tmp/RtmppsizUk/devtools58a949f478b4'’ returned error code 
127”Installation failed: error in running command

'/home/valeriya/anaconda3/envs/myenv/lib/R/bin/R' --no-site-file 
--no-environ  \

--no-save --no-restore --quiet CMD INSTALL  \
  '/tmp/RtmppsizUk/devtools58a913225b77/rstudio-tensorflow-d6df08f'\
  --library='/home/valeriya/anaconda3/envs/myenv/lib/R/library'  \
  --install-tests 

Installation failed: Command failed (1)
'/home/valeriya/anaconda3/envs/myenv/lib/R/bin/R' --no-site-file 
--no-environ  \

 --no-save --no-restore --quiet CMD INSTALL  \

'/tmp/RtmppsizUk/devtools58a95a711ad4/rstudio-keras-900088e'  \

--library='/home/valeriya/anaconda3/envs/myenv/lib/R/library'  \

 --install-tests 


Installation failed: Command failed (1)
当我尝试通过安装它时

install.packages("keras")
我收到下一条警告信息:

also installing the dependencies ‘cli’, ‘testthat’, ‘processx’,     
‘tensorflow’

Warning message in install.packages("keras"):
“installation of package ‘cli’ had non-zero exit status”Warning 
message in install.packages("keras"):
“installation of package ‘testthat’ had non-zero exit status”Warning 
message in install.packages("keras"):
“installation of package ‘processx’ had non-zero exit status”Warning 
message in install.packages("keras"):
“installation of package ‘tensorflow’ had non-zero exit 
status”Warning message in install.packages("keras"):
“installation of package ‘keras’ had non-zero exit status”Updating 
HTML index of packages in '.Library'
Making 'packages.html' ... done
在那之后,通过

library('keras')
给予

Error in library("keras"): there is no package called ‘keras’
Traceback:

1. library("keras")
2. stop(txt, domain = NA)

如何修复它?提前谢谢!

RStudio在其网站上有一个优秀的TensorFlow with R演练!请查看完整的安装和使用文档

要为R安装Keras,请执行以下操作:

devtools::install\u github(“rstudio/keras”)

然后,在使用
devtools
从GitHub克隆
rstudio/keras
之后:

库(keras)

安装keras()

您是否先试用了CRAN版本?
安装程序包(“keras”)
@kluu,当我尝试这样做时,我会收到一条长长的警告消息(我会将其添加到问题中),然后通过“library”(“keras”)加载keras'不起作用。嗯……您是否为Python安装了tensorflow和keras?@kluu是的,我安装了。如果有帮助,我使用带R内核的ipython笔记本。好的……我正在尝试在新的VM上重现错误。您能试着在R控制台中运行相同的命令吗?