Skip to content

Latest commit

 

History

History

train

Imagelytics - Training scripts

Prerequisites

  • Training process relies on TensorFlow 2.9.3.
  • To be able to use TensorFlow 2.9.3 on GPU you must first install CUDA 11.2 and cuDNN 11.2.
  • After setting up CUDA and cuDNN, install project requirements listed in requirements.txt file.

Train model on a custom dataset

  1. Create root folder for the dataset and place images into data/data_original subfolder. Images for each class should be placed in a separate folder. Name of these folders should correspond to class names.
  2. In settings.py change value for root_folder variable to appropriate value.
  3. Reset experiment_no to 1 and check other parameters available in settings.py.
  4. Run prepare_data.py script to resize images and divide them into train, validation, and test subsets.
  5. Run train.py to train the model, generate confusion matrices and Grad-CAM heatmaps. Results will be saved to tmp dataset subfolder.
  6. In case training crushes due to lack of memory, reduce batch_size or choose smaller model and repeat training.
  7. Once training is finished, you may find results in tmp folder, under the current experiment subfolder.