使用 R Keras 开发深度学习,我想实现 earlystopping 回调,但它显示错误:Error in as.integer(verbose) : cannot coerce type 'environment' to vector of type 'integer'
R代码:
# Compiling the model
model %>% compile(loss = "categorical_crossentropy",
optimizer = "adam",
metrics = c("accuracy"))
history <- model %>%
fit(x_train,
y_train,
epoch = 250,
batch_size = 32,
callback_early_stopping(monitor = "val_loss",
min_delta = 0.001,
patience = 5,
restore_best_weights = TRUE,
verbose = 1),
validation_split = 0.2
)
知道有什么问题吗?谢谢。