Training the Model

Once your data is transferred to your training node, you are now ready to use Tensorflow to train a self-driving model.

Training the Model on the Chameleon Node:

  1. By default, donkeycar uses the tflite_linear model to train, but we want to use the normal linear model. To change this, go into myconfig.py and change DEFAULT_MODEL_TYPE to linear.

cd ~/mycar
nano myconfig.py

The line with DEFAULT_MODEL_TYPE should look like this:

DEFAULT_MODEL_TYPE = 'linear'
  1. Utilizing all of the gathered data, train a model

cd mycar
donkey train --tub ./data/[data subdirectory] --model ./models/<model_name>.h5

Note: be sure to include the .h5 at the end of the model filename

Optional Training Changes

  1. It is possible to make edits to how the model trains through augmentations and transformations

nano ~/mycar/myconfig.py
  1. Some options to play around with include:

OPTIMIZER = 'adam'                #adam, sgd, rmsprop, etc.. None accepts default
...
AUGMENTATIONS = ['BLUR']         # changes to image only applied in training to create
#                            # more variety in the data.
TRANSFORMATIONS = ['CROP']       # changes applied _before_ training augmentations,
#                            # such that augmentations are applied to the transformed image,
  1. You can search for words, like "OPTIMIZER", using ^W.

  2. Note: It is very important that the myconfig.py files match between the cars and the Chameleon node, if one thing changes, the other must be changed as well. The following command can be used to sync the files just in case:

rsync cc@<training_ip_address>:~/mycar/myconfig.py ~/car/myconfig.py

Last updated