diff --git a/R/install.R b/R/install.R index 47ffa2a67..b92226ffb 100644 --- a/R/install.R +++ b/R/install.R @@ -22,8 +22,8 @@ install_keras <- function(..., envname = "r-keras", extra_packages = NULL, - python_version = "3.9", - backend = c("tensorflow", "jax", "pytorch") + python_version = "3.9" + # backend = c("tensorflow", "jax", "pytorch") ) { # # envname = "r-keras", # # new_env = identical(envname, "r-keras") @@ -52,12 +52,13 @@ install_keras <- function(..., # browser() system2 <- reticulate:::system2t system2("git", "pull") - # system2(python, c("-m pip install -r requirements.txt")) # unpin tf-nightly for Python 3.12 + system2(python, c("-m pip install -r requirements.txt")) # unpin tf-nightly for Python 3.12 + + # system2(python, c("-m pip install ipython")) # for interactive debugging + # system2(python, c("-m pip install -r requirements-common.txt")) + # system2(python, c("-m pip install torch torchvision")) # needed for pip_build.py?? (but why?) + # system2(python, c("-m pip install tf-nightly jax[cpu]")) # unpin tf-nightly for Python 3.12 - system2(python, c("-m pip install ipython")) # for interactive debugging - system2(python, c("-m pip install -r requirements-common.txt")) - system2(python, c("-m pip install torch torchvision")) # needed for pip_build.py?? (but why?) - system2(python, c("-m pip install tf-nightly jax[cpu]")) # unpin tf-nightly for Python 3.12 system2(python, c("pip_build.py --install")) message("Done!") diff --git a/man/install_keras.Rd b/man/install_keras.Rd index 9d166aa61..fc046e015 100644 --- a/man/install_keras.Rd +++ b/man/install_keras.Rd @@ -8,8 +8,7 @@ install_keras( ..., envname = "r-keras", extra_packages = NULL, - python_version = "3.9", - backend = c("tensorflow", "jax", "pytorch") + python_version = "3.9" ) } \arguments{ diff --git a/tests/testthat/helper-utils.R b/tests/testthat/helper-utils.R index 821011544..b6ab41947 100644 --- a/tests/testthat/helper-utils.R +++ b/tests/testthat/helper-utils.R @@ -5,7 +5,8 @@ # 3 = INFO, WARNING, and ERROR messages are not printed -print_keras_config <- function() { + +reticulate:::py_register_load_hook("keras", function() { print(reticulate::py_config()) # print(keras$`__version__`) # print(keras$`__path__`) @@ -20,13 +21,8 @@ print_keras_config <- function() { # keras$layers # force load # py_main$keras <- keras # py_eval("keras.config.disable_traceback_filtering()") -} +}) -if(reticulate::py_available()) { - print_keras_config() -} else { - setHook("reticulate.onPyInit", print_keras_config) -} if (reticulate::py_module_available("tensorflow")) { # force verbose tf init messages early