Success at installing TensforFlow into R-studio

So I hit the right github thread (https://github.com/rstudio/keras/issues/434#issuecomment-403200040) that led to being able to install TF in Rstudio. The issue had been around the decision for pip maintainters to no longer expose the main() function. When installing keras or TF in Rstudio aimed at a virtualenv, it automatically downloads the latest version of pip and uses that to install the python packages (TF/Keras in this case).  A reader provided a zip file with modified code for ‘utils.R’ and ‘install.R’ which get sourced prior to invoking install_tensorflow. The author also indicated that you need to specifically use TF 1.5 (current is 1.6 I think). The new install also accesses keras as an option to the install_tensorflow command rather than get created from a separate install_keras command.

What’s less clear to me is why this wouldn’t be incorporated into the keras or tensorflow packages in R? They closed the issue but I saw no evidence that it was used as part of the new package?

I did run into one other item which was interesting. Once the above problem was addressed, I was failing due to lack of space. It turns out that install_tensorflow is using temp space to download needed packages and it is the temp directory which was running out of space. To get around that, I created an .Renviron file which specified TMPDIR to a directory in my home area (which I created).  R command ‘tempdir()’ confirms (after restarting R-session) that this is the appropriate temp directory and it all worked thereafter. On accessing Session, I did get this cryptic statement though…

2019-01-20 12:07:11.999849: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1

Leave a comment