Keras: Keras library : Installation failed

Created on 21 Jun 2017  ·  10Comments  ·  Source: rstudio/keras

Hi

I am a newbie to Deep-learning & trying to install Keras library into R-Studio but with below error,

> library(devtools)
> install_github("rstudio/keras")
Downloading GitHub repo rstudio/keras@master
from URL https://api.github.com/repos/rstudio/keras/zipball/master
Installing keras
Installation failed: missing value where TRUE/FALSE needed
Error in if (file.exists(dest) && file.mtime(dest) > file.mtime(lib) &&  : 
  missing value where TRUE/FALSE needed

If I try installing from R-GUI then,

> install_github('rstudio/keras')
Downloading GitHub repo rstudio/keras@master
from URL https://api.github.com/repos/rstudio/keras/zipball/master
Installing keras
Installing 1 package: R6
Installing package into ‘C:/Users/'username'/Documents/R/win-library/3.4’
(as ‘lib’ is unspecified)
Installation failed: missing value where TRUE/FALSE needed
Downloading GitHub repo rstudio/reticulate@master
from URL https://api.github.com/repos/rstudio/reticulate/zipball/master
Installing reticulate
Installation failed: missing value where TRUE/FALSE needed
Downloading GitHub repo rstudio/tensorflow@master
from URL https://api.github.com/repos/rstudio/tensorflow/zipball/master
Installing tensorflow
Installation failed: missing value where TRUE/FALSE needed
"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" --no-site-file --no-environ --no-save  \
  --no-restore --quiet CMD INSTALL  \
  "C:/Users/'username'/AppData/Local/Temp/RtmpyYqQzk/devtools33f466c72026/rstudio-keras-887dd15"  \
  --library="C:/Users/'username'/Documents/R/win-library/3.4"  \
  --install-tests 

* installing *source* package 'keras' ...
** R
** inst
** tests
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  namespace 'reticulate' 0.8.0.9005 is being loaded, but >= 0.8.0.9007 is required
ERROR: lazy loading failed for package 'keras'
* removing 'C:/Users/'username'/Documents/R/win-library/3.4/keras'
Installation failed: Command failed (1)

Please help me to fix this!!!

Most helpful comment

I had some same errors while Installing These packages , and what i finally found was that my major packages such as *Rcpp , curl ,jsonlite* were not properly installed or were outdated , so i first updated Rcpp , then
what i did was step by step installed all necessary packages with proper debugging if some errors occured--

>install.packages("devtools")
>require(devtools)
>install_github("rstudio/reticulate")
>install_github("rstudio/tensorflow")
>install_github("rstudio/keras")

After some time all these packages were installed successfully . So there might be a possibility in your case too.
Just try this out once , and just update with any other errors or complications.
Hope this was helpful.
Refer This for more details https://github.com/rstudio/keras/issues/40

All 10 comments

I had some same errors while Installing These packages , and what i finally found was that my major packages such as *Rcpp , curl ,jsonlite* were not properly installed or were outdated , so i first updated Rcpp , then
what i did was step by step installed all necessary packages with proper debugging if some errors occured--

>install.packages("devtools")
>require(devtools)
>install_github("rstudio/reticulate")
>install_github("rstudio/tensorflow")
>install_github("rstudio/keras")

After some time all these packages were installed successfully . So there might be a possibility in your case too.
Just try this out once , and just update with any other errors or complications.
Hope this was helpful.
Refer This for more details https://github.com/rstudio/keras/issues/40

It was the problem with reticluate version. I upgraded it & is working fine now.

Thank you very much!!

Anytime @YashwanthGithub , Glad that it's working .

When I am trying to install TensorFlow, I Keep on receiving this error even though I updated R & R Studio & Packages. What should i do get rid of this error. & I was using the procedure given in the link. https://tensorflow.rstudio.com/installation.html & I am facing problem at the 1st command its self.

Downloading GitHub repo rstudio/reticulate@master
from URL https://api.github.com/repos/rstudio/reticulate/zipball/master
Error: running command '"C:/PROGRA~1/R/R-34~1.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD config CC' had status 127

I'm not sure. This is a failure to install a package from GitHub which
could have many different sources of error. My guess is that the following
fails as well:

devtools::install_github("rstudio/reticulate")

If that fails I'd suggest updating devtools via:

install.packages("devtools")

And if that fails you may want to report an issue on the devtools
repository.

On Sat, Jul 1, 2017 at 2:13 PM, HARIGB notifications@github.com wrote:

When I am trying to install TensorFlow, I Keep on receiving this error
even though I updated R & R Studio & Packages. What should i do get rid of
this error. & I was using the procedure given in the link.
https://tensorflow.rstudio.com/installation.html & I am facing problem at
the 1st command its self.

Downloading GitHub repo rstudio/reticulate@master
from URL https://api.github.com/repos/rstudio/reticulate/zipball/master
Error: running command '"C:/PROGRA1/R/R-341.1/bin/x64/R" --no-site-file
--no-environ --no-save --no-restore --quiet CMD config CC' had status 127


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/rstudio/keras/issues/46#issuecomment-312447444, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAGXx4Eq8ugvvNaZbqOxSRf25VvmB6SYks5sJoxAgaJpZM4OAe9Z
.

Something that worked for me:
(0) Uninstall package 'keras', if installed from CRAN.

Do following on RStudio's command line:
(1) install.packages("devtools")
(2) require(devtools)
(3) devtools::install_github("rstudio/keras")

Installation Done.

Load it by going to "Packages" tab -> Search for keras -> Check mark it.

Run examples, should work!

Good Luck

--Nitzblitz

install.packages("devtools")
require(devtools)
install.packages("reticulate")
library(reticulate)
install.packages("yaml")
library(yaml)
install.packages("tensorflow")
library(tensorflow)
install_github("rstudio/keras")
library(keras)

I used the upper commands to solve this questions.
我使用了上面的几行命令解决了这个问题。希望你也如此。

install_github("rstudio/keras")

Hi, zhulinmails,
I followed your install instructions unfortunately in the last step I got the 443 port error:
install_github("rstudio/keras")
Error in curl::curl_fetch_memory(url, handle = h) : Failed to connect to api.github.com port 443: Timed out

I did try also this:
with_config(use_proxy("..................",port=..............), install_github("rstudio/keras"))

Unfortunately without sucess.. Some ideas?? Thx.

Best regards,

Vlad.

I had some same errors while Installing These packages , and what i finally found was that my major packages such as *Rcpp , curl ,jsonlite* were not properly installed or were outdated , so i first updated Rcpp , then
what i did was step by step installed all necessary packages with proper debugging if some errors occured--

>install.packages("devtools")
>require(devtools)
>install_github("rstudio/reticulate")
>install_github("rstudio/tensorflow")
>install_github("rstudio/keras")

After some time all these packages were installed successfully . So there might be a possibility in your case too.
Just try this out once , and just update with any other errors or complications.
Hope this was helpful.
Refer This for more details https://github.com/rstudio/keras/issues/40

Hi Anish,

I have followed the below syntax but still getting the error. Plz advice, is there any work around to resolve it.

install.packages("devtools")
require(devtools)
install_github("rstudio/reticulate")
install_github("rstudio/tensorflow")
install_github("rstudio/keras")
library(reticulate)
library(tensorflow)
library(keras)
model_k = keras_model_sequential()
Error: Installation of TensorFlow not found.

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

You can install TensorFlow using the install_tensorflow() function.

Unfortunately, it just does not work in Mainland China.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mrugankakarte picture Mrugankakarte  ·  5Comments

fderyckel picture fderyckel  ·  4Comments

mg64ve picture mg64ve  ·  5Comments

masterlord99 picture masterlord99  ·  6Comments

tbonne picture tbonne  ·  5Comments