The following steps should mostly work, but there may be additional steps you need to take to make things work perfectly. This certainly is not the cleanest code you'll see. I learned Python and Keras as I went.
- Install CUDA 10.0
- Sign up for the NVIDIA Developer Program
- Download cuDNN (v7.5.1 for CUDA 10.0)
- Follow the instructions here to install cuDNN
- Finally, install TensorFlow and Keras:
pip3 install tensorflow-gpu
pip3 install keras
- Run split_data_cub.py and/or split_data_nabirds.py to split the CUB-200-2011 and NABirds datasets, respectively (some modifications may need to be made to the paths)
- An extra directory named images is made in this process. I moved the child folders of that directory to the same level and then deleted it
- Make sure
mode = "train"
is set inside main.py - Uncomment the lines for the dataset you wish to use
- Uncomment the lines for the base model you wish to use
- Rename the file the model will be saved to
- Run main.py
- Make sure
mode = "test"
is set inside main.py - Uncomment the lines for the dataset you wish to use
- Make sure the name of the model being loaded matches the one you saved after training
- Run main.py. The output is the loss and accuracy
I kept these files here as a remnant of other things I tried. They are not used.
- crop_to_bounding_box.py
- nabirds.py
- split_data.py
- try_model.py