luz_callback_model_checkpoint(save_best_only = TRUE) does not save a file
skeydan opened this issue · comments
Sigrid Keydana commented
From the unit test, but with the first call deleted:
model <- get_model()
dl <- get_dl()
mod <- model %>%
setup(
loss = torch::nn_mse_loss(),
optimizer = torch::optim_adam,
)
tmp <- tempfile(fileext = "/")
output <- mod %>%
set_hparams(input_size = 10, output_size = 1) %>%
fit(dl, verbose = FALSE, epochs = 10, callbacks = list(
luz_callback_model_checkpoint(path = tmp, monitor = "train_loss",
save_best_only = TRUE)
))
files <- fs::dir_ls(tmp)
Error: [ENOENT] Failed to search directory '/tmp/RtmpNZqMl3/filee8e165e5548d': no such file or directory