From e24b6eef5a61742ac3c339479c69b4475a59403a Mon Sep 17 00:00:00 2001 From: Cornelius Specht Date: Thu, 13 Jun 2024 11:28:56 +0200 Subject: [PATCH] add epochs to py --- .woodpecker.yml | 2 +- run.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 8243b9a..8d770db 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,5 +1,5 @@ matrix: - MSTEPS: + EPOCHS: - 20 - 30 diff --git a/run.py b/run.py index 4ad0f64..d4fa441 100644 --- a/run.py +++ b/run.py @@ -8,6 +8,10 @@ import os from keras import backend as K K.clear_session() +EPOCHS = int(os.getenv("EPOCHS", default = 10)) + + + gpus = tf.config.experimental.list_physical_devices('GPU') # if gpus: # try: @@ -71,7 +75,7 @@ with tf.device('/GPU:0'): model.compile(optimizer='SGD', loss='categorical_crossentropy', metrics=['accuracy']) - model.fit(X_train_scaled, y_train_categorical, epochs=25) + model.fit(X_train_scaled, y_train_categorical, epochs=EPOCHS) model.save('mymodel.keras') print("finished training")