Coder Social home page Coder Social logo

imagenette-ddp's Introduction

Distributed Training in PyTorch on ImageNette

This repository contains working code to train on ImageNette using DISTRIBUTED DATA PARALLEL (DDP) in PyTorch and Hugging Face Accelerate.

๐Ÿค— Accelerate - DOCS | GitHub

For a deep-dive into the HF Accelerate package, refer to Inside Hugging Face's Accelerate!.

To be able to run the scripts, please run the following commands first from the root directory of this repository to download the data:

mkdir data && cd data 
wget https://s3.amazonaws.com/fast-ai-imageclas/imagenette2-160.tgz
tar -xvf imagenette2-160.tgz

Now you should have a data directory in the repository whose folder structure looks like:

data/
โ””โ”€โ”€ imagenette2-160
    โ”œโ”€โ”€ train
    โ”‚   โ”œโ”€โ”€ n01440764
    โ”‚   โ”œโ”€โ”€ n02102040
    โ”‚   โ”œโ”€โ”€ n02979186
    โ”‚   โ”œโ”€โ”€ n03000684
    โ”‚   โ”œโ”€โ”€ n03028079
    โ”‚   โ”œโ”€โ”€ n03394916
    โ”‚   โ”œโ”€โ”€ n03417042
    โ”‚   โ”œโ”€โ”€ n03425413
    โ”‚   โ”œโ”€โ”€ n03445777
    โ”‚   โ””โ”€โ”€ n03888257
    โ””โ”€โ”€ val
        โ”œโ”€โ”€ n01440764
        โ”œโ”€โ”€ n02102040
        โ”œโ”€โ”€ n02979186
        โ”œโ”€โ”€ n03000684
        โ”œโ”€โ”€ n03028079
        โ”œโ”€โ”€ n03394916
        โ”œโ”€โ”€ n03417042
        โ”œโ”€โ”€ n03425413
        โ”œโ”€โ”€ n03445777
        โ””โ”€โ”€ n03888257

Launch training using PyTorch DDP

To launch training using PyTorch DDP, run the following command from the src folder of this repository:

./ddp.sh <number-of-gpus>

Launch training using Huggingface Accelerate

To launch training using Huggingface Accelerate, run the following command from the src folder of this repository:

accelerate launch train_accelerate.py

imagenette-ddp's People

Contributors

amaarora avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.