* using log directory ‘/data/blackswan/ripley/R/packages/tests-devel/kerasnip.Rcheck’ * using R Under development (unstable) (2026-01-29 r89354) * using platform: x86_64-pc-linux-gnu * R was compiled by gcc (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) GNU Fortran (GCC) 14.2.1 20240912 (Red Hat 14.2.1-3) * running under: Fedora Linux 40 (Workstation Edition) * using session charset: UTF-8 * checking for file ‘kerasnip/DESCRIPTION’ ... OK * this is package ‘kerasnip’ version ‘0.1.0’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘kerasnip’ can be installed ... [12s/12s] OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking whether startup messages can be suppressed ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [17s/17s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... OK * checking examples with --run-donttest ... ERROR Running examples in ‘kerasnip-Ex.R’ failed The error most likely occurred in: > ### Name: keras_evaluate > ### Title: Evaluate a Kerasnip Model > ### Aliases: keras_evaluate > > ### ** Examples > > ## No test: > if (requireNamespace("keras3", quietly = TRUE)) { + library(keras3) + library(parsnip) + + # 1. Define layer blocks + input_block <- function(model, input_shape) { + keras_model_sequential(input_shape = input_shape) + } + hidden_block <- function(model, units = 32) { + model |> layer_dense(units = units, activation = "relu") + } + output_block <- function(model, num_classes) { + model |> layer_dense(units = num_classes, activation = "softmax") + } + + # 2. Define and fit a model ---- + create_keras_sequential_spec( + model_name = "my_mlp_tools", + layer_blocks = list( + input = input_block, + hidden = hidden_block, + output = output_block + ), + mode = "classification" + ) + + mlp_spec <- my_mlp_tools( + hidden_units = 32, + compile_loss = "categorical_crossentropy", + compile_optimizer = "adam", + compile_metrics = "accuracy", + fit_epochs = 5 + ) |> set_engine("keras") + + x_train <- matrix(rnorm(100 * 10), ncol = 10) + y_train <- factor(sample(0:1, 100, replace = TRUE)) + train_df <- data.frame(x = I(x_train), y = y_train) + + fitted_mlp <- fit(mlp_spec, y ~ x, data = train_df) + + # 3. Evaluate the model on new data ---- + x_test <- matrix(rnorm(50 * 10), ncol = 10) + y_test <- factor(sample(0:1, 50, replace = TRUE)) + + eval_metrics <- keras_evaluate(fitted_mlp, x_test, y_test) + print(eval_metrics) + + # 4. Extract the Keras model object ---- + keras_model <- extract_keras_model(fitted_mlp) + summary(keras_model) + + # 5. Extract the training history ---- + history <- extract_keras_history(fitted_mlp) + plot(history) + remove_keras_spec("my_mlp_tools") + } Attaching package: ‘parsnip’ The following object is masked from ‘package:kerasnip’: get_model_env Error: ModuleNotFoundError: No module named 'keras' Run `reticulate::py_last_error()` for details. Execution halted * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘testthat.R’ OK * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... [65s/37s] OK * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * checking for new files in some other directories ... OK * DONE Status: 1 ERROR See ‘/data/blackswan/ripley/R/packages/tests-devel/kerasnip.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 2:57.50, 143.63 + 64.76