How to do it...

  1. First, we import all libraries as follows:
import pandas as pdimport numpy as npimport cv2import mathfrom keras.models import Sequentialfrom keras.layers.core import Dense, Dropout, Activation, Lambdafrom keras.layers import Input, ELUfrom keras.optimizers import SGD, Adam, RMSpropfrom keras.utils import np_utilsfrom keras.layers import Conv2D, MaxPooling2D, Flattenfrom keras import initializersfrom keras.callbacks import ModelCheckpoint
  1. Next, we load the training data as follows:
data_path = 'Data/SDC/training.csv'data = pd.read_csv(data_path, header=None, skiprows=[0], names=['center', 'left', 'right', 'steering', 'throttle', 'brake', 'speed'])
  1. We need to define some image parameters before proceeding:
 img_cols = ...

Get Python Deep Learning Cookbook 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.