Coder Social home page Coder Social logo

oke-aditya / pytorch_cnn_trainer Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 5.0 574 KB

A Simple but Powerful CNN Trainer For PyTorch

Home Page: https://oke-aditya.github.io/pytorch_cnn_trainer/

License: GNU General Public License v3.0

Python 100.00%
hacktoberfest transfer-learning torchvision

pytorch_cnn_trainer's Introduction

PyTorch CNN Trainer

  • Note that this PyPi package is no longer maintained. It will work fine upto this release, but I won't do bug fixes.
  • The entire code and API is migrated to Quickvison, it has similar API and is maintained actively.

Check Formatting Code style: black CI Tests PyPi Release Deploy mkdocs Install Package Downloads Downloads Downloads

Train CNN for your task

A simple engine to fine tune CNNs from torchvision and Pytorch Image models from Ross Wightman.

Example

Why This Package ?

It is very annoying to write training loop and training code for CNN training. Also to support all the training features it takes massive time.

Usually we don't need distributed training and it is very uncomfortable to use argparse and get the job done.

This simplifies the training. It provide you a powerful engine.py which can do lot of training functionalities. Also a dataset.py to load dataset in common scenarios.

Note: - Pytorch Trainer is not a distributed training script.

It will work good for single GPU machine for Google Colab / Kaggle.

But for distributed Training you can use the PyTorch Lightning Trainer (soon).

It will train on multiple GPUs just the way lightning supports (soon).

To install

Install torch and torchvision from PyTorch Run the following in terminal.

pip install -q git+git://github.com/oke-aditya/pytorch_cnn_trainer.git

Or from PyPI now !!

pip install pytorch_cnn_trainer

Docs: -

I have provided some example of how to use this trainer in multiple scenarios. Please check examples folder. Some examples that are provided.

  • Fine Tune Torchvision models using fit().
  • Fine Tune Torchvision models using train_step() and validation_step().
  • Fine Tune Ross Wightman's models.
  • Quantization Aware Training head only.
  • Quantization Aware Training Fully.
  • Mixed Precision Training
  • Training with Stochastic Weighted Average (SWA)
  • LR Finder implementation

Features: -

  • Support PyTorch image models (timm) training and transfer learning.
  • Quantization Aware training example.
  • Early stopping with patience.
  • Support torchvision models trainging and transfer learning.
  • Support torchvision quantized models transfer learning.
  • Support for Mixed Precision Training.
  • L2 Norm Gradient Penalty.
  • LR Finder Implementation.
  • SWA Stochastic weighted Averaging support for training.
  • Add Keras Like fit method.
  • Sanity Check method.

Hope this repo helps people to train models using transfer learning.

If you like it do give * and tell people about it.

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.