Skip to content

adrianmarino/self-driving-car-model

Repository files navigation

Self driving car model

Test videos

Test 1: Test model on track that was used to generate training & test samples.

Track 2 of self-driving-car-simator Version 2

Test 2: Test model over a track that it never saw.

Track 2 of self-driving-car-simator Version 1

Requeriments

Setup

Step 1: Create project environment.

$ conda env create --file environment.yml

Step 2: Activate environment.

$ conda activate self-driving-car-model

Note: This step is required before run train_mode.py or drive.py.

Train model

You can train and adjust model from Self driving car model analysis notebook or use train_model.py script. First of all you need a dataset, but already exist a dataset that was created to train the model, so you can download this. To train model follow next steps:

Step 1: Activate environment.

Step 2: Download dataset from here to project path.

Step 3: Extract dataset.

$ 7z x self-driving-car-dataset.7z

Step 4: Train model (using train_model.py script).

$ python train_model.py

Notes

  • This script load model last weights from /checkpoints path if it exists.
  • Can change epochs and learning rate with --epochs value --lr value.

Step 5: Monitor train/validation loss and steering angle RMSE from Tensorboard. First of all you need run tensor board as follows:

$ tensorboard --logdir logs

Note: train_model.py script write metrics under ./logs directory and tensoboard read from this.

Step 6: Go to http://localhost:6006 url.

Play model

To test model with a track that it never saw use self-driving-car-sim Version 1. You can also test model with any track from Version 2, but the model already know this tracks, given these were used to generate the training and validation samples.

To play model

Step 1: Download self-driving-car-sim Version 1.

Step 2: Execute simulator, select Track 2 and press Autonomous Mode.

Step 3: Activate environment.

Step 4: Execute model client.

$ python drive.py checkpoints/weights__loss_0.0525__rmse_0.2055.h5