knitr::opts_chunk$set(echo = TRUE, eval = FALSE)
digitalDLSorteR is based on Deep Neural Network (DNN) models. To use them, keras package (available on CRAN), a high-level neural networks API implemented in Python, is used. keras R package works as an interface between these two languages by using the reticulate package. Therefore, keras requires a Python interpreter to work. We recommend using conda environments to provide a Python interpreter with all its dependencies covered. If you already have a conda environment compatible with keras requirements, the package is supposed to find it automatically during the installation. Otherwise, keras will create a new environment called r-reticulate
with all these dependencies covered. There are other ways to install a functionally back-end and customized installations are possible, see https://keras3.posit.co/articles/getting_started.html and https://tensorflow.rstudio.com/installation/ for more details.
In addition, digitalDLSorteR provides the installTFpython
function, a helper function to install miniconda (if needed) and create a conda environment called digitaldlsorter-env
with all dependencies covered (a Python interpreter with tensorflow = 2.6). We recommend using installTFpython
to install tensorFlow Python library.
installTFpython(install.conda = TRUE)
If you experiment errors related to its installation and/or keras is not able to find a functional Python environment, you can manually install the conda environment by following these steps:
First, in case you don't have miniconda installed, use the following R code using reticulate:
reticulate::install_miniconda() reticulate::conda_create( envname = "digitaldlsorter-env", packages = "python==3.7.11" )
Or type in a Terminal:
conda create --name digitaldlsorter-env python=3.8 tensorflow=2.6
Then, instead of using keras::install_keras()
function, run the following code chunk using the tensorflow R package. This code will create a Python interpreter with tensorflow with all its dependencies covered.
tensorflow::install_tensorflow( method = "conda", conda = reticulate::conda_binary("auto"), envname = "digitaldlsorter-env", version = "2.6.0-cpu" )
Finally, although it is automatically done by digitalDLSorteR, if keras still does not recognize the functional environment, set this new environment as the selected Python environment:
tensorflow::use_condaenv("digitaldlsorter-env")
If the Python-interpreter problems do not disappear, it is possible to set manually the interpreter that will be used with reticulate. See the following guide: https://rstudio.github.io/reticulate/articles/versions.html.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.