O'Reilly logo

Python Deep Learning Cookbook by Indra den Bakker

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 = ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required