Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #62

Merged
merged 2 commits into from
Jul 9, 2023
Merged

Dev #62

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions models/export_to_onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ def convert_saved_model_to_onnx(saved_model_path, onnx_output_path):


if __name__ == '__main__':
saved_model_path = 'car_types/best_model/efficientnet-car-type_best_model.h5'
onnx_output_path = 'onnx/car_types/efficientnet-car-type.onnx'
saved_model_path = 'pre_filter/efficientnet-pre-filter-refactored-dataset-2_best_model.h5'
onnx_output_path = 'onnx/pre_filter/efficientnet-pre-filter-refactored-dataset-2.onnx'
convert_saved_model_to_onnx(saved_model_path, onnx_output_path)
10 changes: 5 additions & 5 deletions training/pre_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
AUTOTUNE = tf.data.AUTOTUNE
img_height = 300
img_width = 300
name = "efficientnet-pre-filter-refactored-dataset"
name = "efficientnet-pre-filter-refactored-dataset-2"
# Variables to control training flow
# Set model Type to 'all_specific_model_variants' or 'car_type or 'specific_model_variants'
model_type = 'pre_filter'
Expand Down Expand Up @@ -111,16 +111,16 @@
# Discord callback ( If you want to use this, you need to set the environment variable "WEBHOOK_URL",
# otherwise comment it out and also remove the callback from the model callbacks)
webhook_url = os.environ.get('WEBHOOK_URL')
discord_callback = DiscordCallback(webhook_url)
#discord_callback = DiscordCallback(webhook_url)

# Train model
epochs = 20
with tf.device('/GPU:1'):
epochs = 15
with tf.device('/GPU:0'):
history = model.fit(
train_ds,
validation_data=val_ds,
epochs=epochs,
callbacks=[lr, early_stopping, model_checkpoint, discord_callback]
callbacks=[lr, early_stopping, model_checkpoint]
)
# Plot and save model score
plot_model_score(history, name, model_type)
Expand Down