Skip to content

Commit 24ea18e

Browse files
committed
add note to docs about pandas
1 parent b4fbe4d commit 24ea18e

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

R/preprocessing.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,13 @@ flow_images_from_directory <- function(
886886
#' * "other": array of y_col data,
887887
#' `NULL`, no targets are returned (the generator will only yield batches of
888888
#' image data, which is useful to use in `predict_generator()`).
889+
#'
890+
#' @note
891+
#' This functions requires that `pandas` (python module) is installed in the
892+
#' same environment as `tensorflow` and `keras`.
893+
#'
894+
#' If you are using `r-tensorflow` (the default environment) you can install
895+
#' `pandas` by running `reticulate::py_install("pandas", envname = "r-tensorflow")`.
889896
#'
890897
#' @section Yields: `(x, y)` where `x` is an array of image data and `y` is a
891898
#' array of corresponding labels. The generator loops indefinitely.
@@ -900,6 +907,10 @@ flow_images_from_dataframe <- function(
900907
save_prefix = "", save_format = "png", subset = NULL,
901908
interpolation = "nearest", drop_duplicates = TRUE) {
902909

910+
if (!reticulate::py_module_available("pandas"))
911+
stop("Pandas (python module) must be installed in the same environment as Keras.",
912+
'. Install it using reticulate::py_install("pandas", envname = "r-tensorflow").')
913+
903914
args <- list(
904915
dataframe = as.data.frame(dataframe),
905916
directory = normalize_path(directory),

man/flow_images_from_dataframe.Rd

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)