Skip to content

Commit

Permalink
feature: Added new device
Browse files Browse the repository at this point in the history
  • Loading branch information
Flippchen committed Dec 30, 2023
1 parent f3b3790 commit 9c97ef2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion training/old/vision.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@

# Train model
epochs = 20
with tf.device('/GPU:0'):
device = tf.test.gpu_device_name() if tf.test.is_gpu_available() else '/CPU:0'
print("Using Device:", device)
with tf.device(device):
history = model.fit(
train_ds,
validation_data=val_ds,
Expand Down
4 changes: 3 additions & 1 deletion training/old/with_augmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@

# Train model
epochs = 20
with tf.device('/GPU:1'):
device = tf.test.gpu_device_name() if tf.test.is_gpu_available() else '/CPU:0'
print("Using Device:", device)
with tf.device(device):
history = model.fit(
train_ds,
validation_data=val_ds,
Expand Down
4 changes: 3 additions & 1 deletion training/old/without_augmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@

# Train model
epochs = 20
with tf.device('/GPU:1'):
device = tf.test.gpu_device_name() if tf.test.is_gpu_available() else '/CPU:0'
print("Using Device:", device)
with tf.device(device):
history = model.fit(
train_ds,
validation_data=val_ds,
Expand Down
4 changes: 3 additions & 1 deletion training/pre_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@

# Train model
epochs = 15
with tf.device('/GPU:0'):
device = tf.test.gpu_device_name() if tf.test.is_gpu_available() else '/CPU:0'
print("Using Device:", device)
with tf.device(device):
history = model.fit(
train_ds,
validation_data=val_ds,
Expand Down

0 comments on commit 9c97ef2

Please sign in to comment.