add epochs to py
ci/woodpecker/push/woodpecker/1 Pipeline was successful Details
ci/woodpecker/push/woodpecker/2 Pipeline was successful Details

This commit is contained in:
Cornelius Specht 2024-06-13 11:28:56 +02:00
parent 05291f41f6
commit e24b6eef5a
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
matrix: matrix:
MSTEPS: EPOCHS:
- 20 - 20
- 30 - 30

6
run.py
View File

@ -8,6 +8,10 @@ import os
from keras import backend as K from keras import backend as K
K.clear_session() K.clear_session()
EPOCHS = int(os.getenv("EPOCHS", default = 10))
gpus = tf.config.experimental.list_physical_devices('GPU') gpus = tf.config.experimental.list_physical_devices('GPU')
# if gpus: # if gpus:
# try: # try:
@ -71,7 +75,7 @@ with tf.device('/GPU:0'):
model.compile(optimizer='SGD', model.compile(optimizer='SGD',
loss='categorical_crossentropy', loss='categorical_crossentropy',
metrics=['accuracy']) 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') model.save('mymodel.keras')
print("finished training") print("finished training")