Keras installation

9. Keras installation#

9.1. Attention#

  • Tensorflow compatible CUDA

  • Note that Tensorflow 2.10 was the last version of TensorFlow to natively support GPUs on Windows.

    • There’s no version compatible with CUDA 11.7, therefore, we can not install torch-gpu and tensorflow-gpu in the same time

  • This installation tutorial will only cover tensorflow-cpu version

9.2. Installation steps#

  1. The installation requires super-user permission, make sure you open R studio or cmd as super-user

  2. Install the tensorflow R package from GitHub as follows:

# install.packages("remotes")
remotes::install_github("rstudio/tensorflow")
  1. Make sure Python is installed on your system. (skip if you already have python env)

    1. You can download from www.python.org/downloads, or call the install_python() from reticulate:

    2. reticulate::install_python()

  1. Use keras::install_keras(), which installs TensorFlow, in addition to some commonly used packages like scipy, pandas, and tensorflow-datasets.

install.packages("keras")
library(keras)
install_keras()