Giter Site home page Giter Site logo

image-classification-on-inaturalist-dataset's Introduction

DLAssignment2

Convolution Neural Networks.

For Notebooks of PARTA and PARTB

  • user neeeds to make sure that all dependent and imported libraries are installed in the environment
  • colab does not provide wandb by default and hence a pip install is necessary.

Train.py has both codes for PARTA and PARTB

TO RUN TRAIN.PY

  • train.py has the command Line arguments version of the code. Running it with appropriate parameters will result in training the network from scratch, from a pretrained model, or from a model entirely trained that needs to be loaded.

Note :

  • kernels will have to passed as strings containing space separated integers eg : "5 3 3 3 3"
  • If wandb logging needed, kindly provide the key when prompted. Also, user may want to change the wandb project and entity names via the appropriate arguments.
  • To load trained models, it must be made sure that a the model is in .pth format and is present in the same directory as the train.py file.
  • System/ Environment should have pyTorch installed and updated, along with other basic libraries such as os, zipFile and requests.
  • The train.py downloads the dataset(4 GBs) and extract its. Therefore around 30GBs of free space is recommended.
  • The train.py will take care of whether to extract/ download. In case of a previous failed download, kindly deleted the failed attempt and run the code again.

The Following are some example commandLine directives for running the train.py, user may copy paste the commands mentioned below

  • python train.py --pretrain yes
  • python train.py --load scratch.pth
  • python train.py --log yes --pretrain yes
  • python train.py --log yes -lr 0.01 -b 64 -e 2 -wp Testing2 -we cs22m028 -f 1 -w_d 0.00001 -d 0.5 -k "5 3 3 3 3" -fs 64 -pre yes -bN no

The last commandline will not give best results (non optimal), user requested to use other three commands to use default training parameters, or not change default parameters at all and use the --log, --pretrained and --load only. The last commandline is only given to prove the correct implementation of train.py

To summarise the command Line arguments that can be passed to the train.py :

  • shorthand: '-lg', argument: '--log', Desription: set to no if logging not desired, otherwise, wandb logging done. Prompt to insert key will appear
  • shorthand: '-ld', argument: '--load', Description: set to no if do not wish to load a saved model, otherwise saved model's path(relative to current directory) must be passed.
  • shorthand: '-wp', argument: '--wandb_project' Description: set wandb project name. Default to DLAssignment2
  • shorthand: '-we', argument: '--wandb_entity' Description: set wandb entity name. Default to cs22m028.
  • shorthand: '-e',, argument:'--epochs', Description: set number of epochs for which to train the model (default = 10)
  • shorthand: '-b',, argument:'--batch_size', Description: set batch size ( default = 32 )
  • shorthand: '-f',, argument:'--factor', Description: set factor by which to increase the number of filters ( default = 32 )
  • shorthand: '-lr', argument: '--learningRate', Description: set learning Rate (default to 0.0001)
  • shorthand: '-w_d, argument:, '--weight_decay', Description: set weight decay ( default = 0 )
  • shorthand: '-d',, argument:'--dropOut', Description: set dropOut probability ( default = 0.5 )
  • shorthand: '-k',, argument:'--kernels', Description: set kernel sizees, enter a string of 5 integers ( 5 5 3 3 3)
  • shorthand: '-fs', argument: '--filterSize', Description filter size: number of channels
  • shorthand: '-a',, argument:'--activation', Description: set activation function ( default = "mish" )
  • shorthand: '-pre, argument:, '--pretrained', Description: set whether to load vision transformer model or not ( default = no )
  • shorthand: '-aug, argument:, '--augmentation', Description: set whether to augment dataset or not ( default = yes )
  • shorthand: '-bN', argument: '--batchNorm', Description: set whether to use batchNorm or not ( default = yes )

Note:

  • all parameters except for wandb project/entity names are to be kept to lower case.
  • preTrained VisionTransformer model could not be added to the GitHub repository as it is huge (> 700 MBs)

image-classification-on-inaturalist-dataset's People

Contributors

barenya255 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.