- The model learn to control steering wheel angle.
- Throttle & Break is controlled by a PI Controller.
- The model was trained using all tracks of Udacity self-driving-car-simator Version 2 and tested with track 2 of Version 1 . The idea was try model with a track that it never saw.
- The model was based to End-to-End Deep Learning for Self-Driving Cars network arquitecture.
Test 1: Test model on track that was used to generate training & test samples.
Test 2: Test model over a track that it never saw.
- anaconda
- 7z
- A respectable video card (i.e. GeForce GTX 1060 or higher)
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
.
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.
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.
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