Finetuning AlexNet's and VGG16 layers where the classes are reduced from 1000 to the number of classes in dataset(8) in the classifier layer.
- Install PyTorch by following the instructions given on the link here.
- Run
pip3 install torchvision tensorflow==1.4 tensorboardX
in command line.
- First, get the dataset in two folders: train and test by modifying paths in data_process.py.
Then, execute the command
python3 data_process.py
. - Then modify the dataset path in alexnet.py, where the newly created folders are saved.
- Then run
python3 alexnet.py
.
- Repeat the 2 and 3 steps as mentioned for AlexNet with the following file: vgg16.py.
To visualize the current results, open a terminal session, and run the following command:
tensorboard --logdir runs
- Training Accuracy = 92.53%
- Training Loss = 0.26
- Testing Accuracy = 92.5
- Training Accuracy = 89.63%
- Training Loss = 0.34
- Testing Accuracy = 88.38