Error: Installation of TensorFlow not found in RStudio

Tyring to build some neural networks using Keras from the 'Deep Learning with R' book, I keep encountering the same error that TensorFlow has not been found in my RStudio session. Looked up similar problemshoot (Python module tensorflow was not found. (Similar to issue #144)) but it doesn't solve my error.

Trying to execute this code:

model <- keras_model_sequential() %>%
layer_dense(units = 25, input_shape = c(468)) %>%
layer_dense(units = 12, activation = "softmax")

Followed these steps for using the conda environment that already has TensorFlow:

More info using
reticulate::conda_version()
sessionInfo()

and library(tensorflow)
use_condaenv("tf")
sess <- tf$Session()

I don't understand why this is not working. Hopefully somebody can help me out with this!?

Cheers

I installed Keras/TF on Rstudio Cloud a couple of weeks ago but that is a Linux OS. Still, there is a note in the Keras help about installing on windows that might help:

Keras and TensorFlow will be installed into an "r-tensorflow" virtual or conda environment. Note that "virtualenv" is not available on Windows (as this isn't supported by TensorFlow).

Here is what I used. I used the specific version of Tensorflow that is compatible with the newest keras package.

install.packages("keras")
install_keras(Tensorflow = "1.13.1",
restart_session = FALSE
)
1 Like

Hi Phil,

Thanks for the info. I'm thinking about switching o Ubuntu as Linux distribution as OS, but I wonder if there's anything possible on Keras/Tensorflow installation using Windows 10 before making the jump to Ubuntu.

Hopefully anyone has solved this situation using Windows 10!?

Cheers

Actually solved this one myself by using the Conda environment ("r-reticulate") that the R-package "reticulate" made.

Code:

install.packages("remotes")
remotes::install_github("rstudio/tensorflow")
library(tensorflow)
install_tensorflow(version = "2.0.0b1", method = "conda", envname = "r-reticulate")
library(keras)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.