This repository contains image classification models implemented in Pytorch Lightning. The logging is done with Weights and Biases, integrated to track the metrics and losses. The aim is also to present a clean templete for Pytorch Lightning projects, and present modular and structured code for projects build with Pytorch lightning.
opencv=4.1.2
pytorch=1.9.1
torchvision=0.10.1
pytorch-lightning=1.5.10
scikit-image=0.15.0
wandb
- AlexNet
The project was built in a conda environment. So it is recommended but not necessary to have anaconda/miniconda installed. The environment.yml
has the necessary environment packages.
Clone the repository to your local using,
git clone https://github.com/saiamrit/lightning-image-models.git
cd lightning-image-models
Then setup the conda environment using,
conda env create -f environment.yml
Once the environment is created, activate the environment and run the traintest.p
First, install dependencies
# clone project
git clone https://github.com/saiamrit/lightning-image-models.git
# install project
cd deep-learning-project-template
pip install -e .
pip install -r requirements.txt
Next, navigate to any file and run it.
# module folder
cd project
# run module (example: mnist as your main contribution)
python lit_classifier_main.py
This project is setup as a package which means you can now easily import any file into any other file like so:
from project.datasets.mnist import mnist
from project.lit_classifier_main import LitClassifier
from pytorch_lightning import Trainer
# model
model = LitClassifier()
# data
train, val, test = mnist()
# train
trainer = Trainer()
trainer.fit(model, train, val)
# test using the best model!
trainer.test(test_dataloaders=test)
@article{YourName,
title={Your Title},
author={Your team},
journal={Location},
year={Year}
}