Skip to content

Training convnet from scratch using PyTorch for cats vs. dogs classification

License

Notifications You must be signed in to change notification settings

tinkueg/dogs_vs_cats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Train Dogs and Cats classification using PyTorch from scratch

This repository shows Dogs and Cats classification using PyTorch from scratch. Here I use convnet for dogs vs. cats classification. I shwos you how to write a data a data loder from scratch and create a model. There are two different implementation for data loader. The first is from scratch and the second is using prebuilt "datasets.ImageFolder".

A keras implementation for this is given in the Book by "Deep learning with Python" by Francois Chollet.

Crete Virtual Environment

Create a virtiual environment.

conda create conda create --name ml_env_1.11
conda activate ml_env_1.11

Install PyTorch

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

Install matplotlib

conda install -c conda-forge matplotlib

Data Prepration

Download data from https://www.kaggle.com/c/dogs-vs-cats/data and uncompress it. Then execute data_prep.py to prepare train, test data directory with 2000 images of dogs and cats.

python data_prep.py

Training

To train the model on extracted data execute the following command.

python train.py

Results

image info image info

About

Training convnet from scratch using PyTorch for cats vs. dogs classification

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages