This is the ASTRO autonomous racing training folder with training scripts, used in astro_autonomous_racing ROS2 package.
Includes:
splitter.py:
splitter.py splits the images dataset into images/train and images/val.
Usage:
cd ~/astro_ws/
python3 ASTRO_autonomous_racing_model_training_scripts/splitter.pysteerDS_crta.pyis helper script fortrain_net_crta.py:
steerDS_crta.py script describes the remappingg between the steering {cmd_vel.angular.z} to self.class_labels = ['sharp left', 'left', 'straight', 'right', 'sharp right', 'stop']
train_net_crta.py:
Model training script - train_net_crta.py have multiple segments:
SETTING UP THE DATASET- This part of the script sets up the transformations on raw images from /train /val folders to be prepared as inputs to the model. It sets up the train and validation datasets and displays the dataset's class balance and the start. Do not change this segmentCONFIGURE CLASSIFICATION MODEL ARCHITECTURE- This part confiures the model architecture. Here you should specify the architecture. For the reference use this PyTorch Classifer TutorialTRAINING HYPERPARAMETERS- Here you specify the model training hyperparameters: Loss function as criterion, optimizer, number of epochs.TRAINING- Model train segment. Here you specify the name of saved trained model.<model_name>.pthVALIDATION- Validation segment, displays the confusion matrix. Do not chnage this segment
Start model training procedure:
cd ~/astro_ws/
python3 ASTRO_autonomous_racing_model_training_scripts/train_net_crta.py