-
Keras installation in RPython 2023. 4. 11. 08:45
# install the Tensorflow R package install.packages("tensorflow") # configure R with a Python installation library(reticulate) path_to_python <- install_python() virtualenv_create("r-reticulate", python = path_to_python) # install Tensorflow library(tensorflow) install_tensorflow(envname = "r-reticulate") # install Keras install.packages("keras") library(keras) install_keras(envname = "r-reticulate") # === TEST === # configure reticulate library(reticulate) use_virtualenv("r-reticulate") # use Tensorflow library(tensorflow) tf$constant("Hello Tensorflow!") # use Keras network <- keras_model_sequential() %>% layer_dense(units = 8, activation = "relu", input_shape = c(4)) %>% layer_dense(units = 1, activation = "linear") summary(network)
Reference
[1] https://tensorflow.rstudio.com/install/TensorFlow for R - Quick start
Prior to using the tensorflow R package you need to install a version of Python and TensorFlow on your system. Below we describe how to install to do this as well the various options available for customizing your installation. Note that this article princ
tensorflow.rstudio.com
'Python' 카테고리의 다른 글
Run Python using a Shell Script (0) 2021.05.17 [Python] ImportError: attempted relative import with no known parent package (0) 2021.04.18 __call__ (0) 2021.01.20