add epochs to py
This commit is contained in:
parent
05291f41f6
commit
e24b6eef5a
|
@ -1,5 +1,5 @@
|
||||||
matrix:
|
matrix:
|
||||||
MSTEPS:
|
EPOCHS:
|
||||||
- 20
|
- 20
|
||||||
- 30
|
- 30
|
||||||
|
|
||||||
|
|
6
run.py
6
run.py
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue