Code Monkey home page Code Monkey logo

Comments (8)

KaimingHe avatar KaimingHe commented on August 28, 2024 2

We exploit the fact that by default BN is split into multiple GPUs in which mean/std is independently computed. To run on one GPU, you may implement BN split along the N (batch) dimension to mimic this effect (see NaiveBatchNorm in Detectron2). You also need to change the lr (e.g., linearly) if you change the batchsize to fit memory. To run on 2 GPUs, try --lr 0.0075 --batch-size 64.

from moco.

rbgirshick avatar rbgirshick commented on August 28, 2024

implement BN split along the N (batch) dimension to mimic this effect

There is an implementation of split (aka sub-batch) BN for video (3d) models that might be helpful to you:
https://github.com/facebookresearch/SlowFast/blob/master/slowfast/models/batchnorm_helper.py#L37-L46

This can easily be adapted to the the 2d BN case.

from moco.

JaejinCho avatar JaejinCho commented on August 28, 2024

@rbgirshick Thanks for the link. I actually needed this and am writing a code myself starting from there. BTW, if you know, It would be great if you could answer this question, which is regarding the code snippet. facebookresearch/SlowFast#357 (comment)

from moco.

JingLiJJ avatar JingLiJJ commented on August 28, 2024

@rbgirshick Thanks for the link. I actually needed this and am writing a code myself starting from there. BTW, if you know, It would be great if you could answer this question, which is regarding the code snippet. facebookresearch/SlowFast#357 (comment)

@rbgirshick Thanks for the link. I actually needed this and am writing a code myself starting from there. BTW, if you know, It would be great if you could answer this question, which is regarding the code snippet. facebookresearch/SlowFast#357 (comment)

Hello, have you realized this? I also want to implement MOCO on a single GPU.

from moco.

DiaosWang avatar DiaosWang commented on August 28, 2024

@JingLiJJ maybe you can see https://github.com/leftthomas/MoCo

from moco.

solauky avatar solauky commented on August 28, 2024

from moco.

athenacon avatar athenacon commented on August 28, 2024

@JingLiJJ maybe you can see https://github.com/leftthomas/MoCo

Hey! I would really want to run it on a single GPU, but I am not sure if I understand how this implementation works for a single GPU, could you please explain?

from moco.

solauky avatar solauky commented on August 28, 2024

from moco.

Related Issues (20)

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.