Skip to content

Commit 723a8cd

Browse files
committed
call py_require() in .onLoad()
1 parent 20470fe commit 723a8cd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

R/package.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ keras <- NULL
6161
if (!is.null(keras_python))
6262
Sys.setenv(RETICULATE_PYTHON = keras_python)
6363

64+
# default backend is tensorflow for now
65+
# the tensorflow R package calls `py_require()` to ensure GPU is usable on Linux
66+
py_require(c(
67+
"keras", "pydot", "scipy", "pandas", "Pillow",
68+
"ipython", "tensorflow_datasets"
69+
))
70+
6471
# delay load keras
6572
try(keras <<- import("keras", delay_load = list(
6673

0 commit comments

Comments
 (0)