Ask Your Question
0

How can the loss graph be plotted after training using TensorFlow's EfficientDet architecture and the Model Maker library for custom object detection in Google Colab notebook?

asked 2021-07-28 11:00:00 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-04-07 14:00:00 +0000

woof gravatar image

To plot the loss graph after training using TensorFlow's EfficientDet architecture and the Model Maker library for custom object detection in Google Colab notebook, follow these steps:

  1. Import the necessary libraries:
import matplotlib.pyplot as plt
import numpy as np
  1. Load the training logs for the model:
log_file = 'model/logs/efficientdet/model.log'
with open(log_file) as f:
  training_logs = f.read().splitlines()
  1. Extract the loss values from the training logs:
losses = []
for log in training_logs:
  if 'loss =' in log:
    loss_value = float(log.split('loss = ')[-1])
    losses.append(loss_value)
  1. Plot the loss graph:
plt.plot(np.arange(len(losses)), losses)
plt.title('Training Loss')
plt.xlabel('Number of steps')
plt.ylabel('Loss value')
plt.show()

This will create a graph showing the training loss over time.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-07-28 11:00:00 +0000

Seen: 10 times

Last updated: Apr 07 '22