gpu
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
45d58b7723
commit
511187ba16
|
@ -1,8 +1,8 @@
|
|||
steps:
|
||||
"caffe":
|
||||
"train":
|
||||
image: nvcr.io/nvidia/tensorflow:23.10-tf2-py3
|
||||
commands:
|
||||
- echo "ci working................b. "
|
||||
- echo "starting python script"
|
||||
- python run.py
|
||||
|
||||
|
||||
|
|
26
run.py
26
run.py
|
@ -46,18 +46,6 @@ y_test_categorical = keras.utils.to_categorical(
|
|||
|
||||
print("model build")
|
||||
|
||||
model = keras.Sequential([
|
||||
keras.layers.Flatten(input_shape=(32,32,3)),
|
||||
keras.layers.Dense(300, activation='relu'),
|
||||
keras.layers.Dense(100, activation='relu'),
|
||||
keras.layers.Dense(10, activation='sigmoid')
|
||||
])
|
||||
|
||||
model.compile(optimizer='SGD',
|
||||
loss='categorical_crossentropy',
|
||||
metrics=['accuracy'])
|
||||
|
||||
model.fit(X_train_scaled, y_train_categorical, epochs=1)
|
||||
|
||||
def get_model():
|
||||
model = keras.Sequential([
|
||||
|
@ -73,7 +61,17 @@ def get_model():
|
|||
return model
|
||||
|
||||
with tf.device('/GPU:0'):
|
||||
cpu_model = get_model()
|
||||
cpu_model.fit(X_train_scaled, y_train_categorical, epochs=10)
|
||||
model = keras.Sequential([
|
||||
keras.layers.Flatten(input_shape=(32,32,3)),
|
||||
keras.layers.Dense(3000, activation='relu'),
|
||||
keras.layers.Dense(1000, activation='relu'),
|
||||
keras.layers.Dense(10, activation='sigmoid')
|
||||
])
|
||||
|
||||
model.compile(optimizer='SGD',
|
||||
loss='categorical_crossentropy',
|
||||
metrics=['accuracy'])
|
||||
model.fit(X_train_scaled, y_train_categorical, epochs=10)
|
||||
model.save('mymodel.keras')
|
||||
|
||||
print("done")
|
Loading…
Reference in New Issue