From 2b6d093c0d631cf6b5283730937d079b3a50ecad Mon Sep 17 00:00:00 2001 From: hasslesstech Date: Thu, 20 Nov 2025 11:32:33 +0200 Subject: [PATCH] update training method --- train_l_v2.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 train_l_v2.py diff --git a/train_l_v2.py b/train_l_v2.py new file mode 100644 index 0000000..4deaed0 --- /dev/null +++ b/train_l_v2.py @@ -0,0 +1,25 @@ +import tensorflow as tf + +ds_train, ds_valid = tf.keras.preprocessing.image_dataset_from_directory( + '/mnt/tmpfs1/ds-mini-1', + labels = 'inferred', + label_mode = 'categorical', + color_mode = 'rgb', + batch_size = 16, + image_size = (300, 300), + shuffle = False, + validation_split = 0.05, + subset = 'both', + verbose = True +) + +from m import * + +ckpt = kc.ModelCheckpoint("model3.model.keras", + monitor = 'val_accuracy', + save_best_only = True) + +h = mod.fit(ds_train, + epochs = 9, + validation_data = ds_valid, + callbacks = [ckpt])