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:
import matplotlib.pyplot as plt
import numpy as np
log_file = 'model/logs/efficientdet/model.log'
with open(log_file) as f:
training_logs = f.read().splitlines()
losses = []
for log in training_logs:
if 'loss =' in log:
loss_value = float(log.split('loss = ')[-1])
losses.append(loss_value)
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.