Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

A repo for school project, serving mainly for some Computer Vision models comparison on the CIFAR dataset

License

Notifications You must be signed in to change notification settings

fuisl/LIA-introCS-proj

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

banner

GitHub repo size GitHub issues GitHub pull requests GitHub GitHub last commit GitHub contributors


This repository contains the training pipeline for comparing popular Convolutional Neural Network (CNN) models in our report, including AlexNet, VGGNet, YOLO, and ResNet.

Note: YOLO is not included in this pipeline, please refer to its official repository for training.

Prev

Documentation

See below for a quickstart installation and usage example. For more detailed documentation, please refer to the Wiki (coming soon).

Clone

Clone this repository using git:

git clone https://github.com/nhientruong04/LIA-introCS-proj.git

GitHub CLI is also supported, use the following command instead:

gh repo clone nhientruong04/LIA-introCS-proj

Or you can download the repository as a ZIP archive and extract it.

Requirements

Install package and dependencies including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install -r requirements.txt

For alternative installation methods including Conda, Docker, and Git, please refer to the official PyTorch installation guide.

Usage

Training

For training, use the train.py as below in your CLI

python train.py -m <model> -ds <dataset> -bs <batch_size> -e <epochs> --resume <resume> --log <log> --lr <learning_rate> --shuffle <shuffle> --workers <workers>
Option Default Description
-m , --model alexnet Choose the model for training. With models having different variants, choose the specific variant to train, e.g vgg16, resnet101
-ds , --dataset cifar10 Choose the dataset for training. The value must be cifar10 or cifar100
-bs, --batch_size 32 Set the batch size, must be integer
-e, --epochs 10 Set the number of epochs, must be integer
--resume '' Path to the weight for resume training. If specified, the log file of the previous run must also be specified
--log '' Name of the log file, must be pickle file with .pkl format
--lr 0.001 Set the learning rate
--shuffle True Shuffle the dataset
--workers 10 Set the number of workers for the dataloader, must be integer

For example, to train a ResNet-34, with a lr=0.01, epoch=20 and log the process in resnet34.pkl, we'll use:

python train.py -m resnet34 -lr 1e-2 -e 20 --log resnet34.pkl

The flag --log is optional. If not specified, the program will create the log file with different name based on the current time. After the training is done, your result will be stored at runs folder and a weight file named last.pth will be saved at the current directory.
To resume training with any model with a prepared weight (.pt or .pth format), we'll use:

python train.py -m resnet34 --resume /PATH/TO/YOUR/MODEL/WEIGHT --log resnet34.pkl -e 20 --workers 6

Note: an existed log file can still be used. Passing the name of an existed log file will continue to append results to that file.

Contribute

Contributions are always welcome! Our project would not be possible without help from our community. Please visit our contribution guidelines first. Thank you to all of our contributors!

Shout out to all of the team members who have contributed to this project:

We would also like to thank our instructor Dr. Le Trong Nhan for his guidance and support throughout the course.

License

This project is licensed under the MIT License.

Contact

For any bug reports and feature requests please visit GitHub Issues and contact us via email


LIA GitHubspace

About

A repo for school project, serving mainly for some Computer Vision models comparison on the CIFAR dataset

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 82.7%
  • TeX 15.1%
  • Python 2.2%