Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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.