Installing TensorFlow and Keras packages in R
To install the three R packages that support TensorFlow and Keras in R, execute the following commands in R.
- First, install
devtools
:
install.packages("devtools")
- Install the
tensorflow
andtfestimators
package:
devtools::install_github("rstudio/tensorflow") devtools::install_github("rstudio/tfestimators")
- Load the
tensorflow
library and install the required functions:
library(tensorflow) install_tensorflow()
- By default, the install function creates a virtual environment and installs the
tensorflow
package in the virtual environment.
There are four installation methods available, which can be specified using the method parameter:
| Automatically choose a default for the current platform |
| Install into the virtual environment located at ~/.virtualenvs/r-tensorflow |
| Install into the Anaconda Python environment named r-tensorflow |
| Install into the system Python environment |
- By default, the install function installs the CPU-only version of...