Training the neural network for navigation

Let's put our training program together here. We need to have collected our training data, by driving the robot around and recording our driving movements. This separated our data into three sets – left turn, right turn, and go straight. We have our training images in three subfolders to match our labels. We read in our data, associate it with the labels, and pre-process the data to present it to the neural network:

I'm doing the training runs on my desktop computer, not on the Raspberry Pi. We’ll deploy on the Raspberry Pi later with our fully trained networks.
# -*- coding: utf-8 -*- """ CNN based robot navigation – TRAINING program @author: Francis Govers """

This program was partially inspired ...

Get Artificial Intelligence for Robotics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.