@@ -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 ),
0 commit comments