Coder Social home page Coder Social logo

Comments (13)

ZhuFengdaaa avatar ZhuFengdaaa commented on June 6, 2024 79

@penguinshin I fix this bug by adding 64G swap memory. When data loader forks workers to load data, the memory increases rapidly. You can try setting num_workers=1 first, then try allocating larger swap space.

from resnext.pytorch.

rajatagrawal193 avatar rajatagrawal193 commented on June 6, 2024 46

**Fixed this ** by allocating 4G swap memory. You can try allocating more memory if 4G does not suffice.
Follow this blog to allocate swap memory on your device.
https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04

from resnext.pytorch.

monacv avatar monacv commented on June 6, 2024 6

Fixed the problem by allocating 64GB of swap memory from the external disk.

from resnext.pytorch.

prlz77 avatar prlz77 commented on June 6, 2024 3

OSError: [Errno 12] Cannot allocate memory sounds more like a RAM problem, not a GPU problem. Check you have enough RAM/SWAP, and the correct user permissions.

from resnext.pytorch.

usamec avatar usamec commented on June 6, 2024 3

Fix is almost always:
echo 1 > /proc/sys/vm/overcommit_memory

https://stackoverflow.com/a/52311756/1391392

from resnext.pytorch.

nbansal90 avatar nbansal90 commented on June 6, 2024

Yeah Exactly!
Meanwhile, I collected the output of lspci command:(for NVIDIA 1080 TI)

bansa01@vita:~/pytorch_resnext/tmp$ lspci -v -s 89:00.0
89:00.0 VGA compatible controller: NVIDIA Corporation Device 1b06 (rev a1) (prog-if 00 [VGA controller])
        Subsystem: ZOTAC International (MCO) Ltd. Device 1470
        Flags: bus master, fast devsel, latency 0, IRQ 105
        Memory at f4000000 (32-bit, non-prefetchable) [size=16M]
        Memory at 2ff80000000 (64-bit, prefetchable) [size=256M]
        Memory at 2ff90000000 (64-bit, prefetchable) [size=32M]
        I/O ports at b000 [size=128]
        [virtual] Expansion ROM at f5000000 [disabled] [size=512K]
        Capabilities: <access denied>
        Kernel driver in use: nvidia
        Kernel modules: nvidiafb, nouveau, nvidia_384_drm, nvidia_384

Does this give us any information as to where we might be going wrong. Can I change anything myself,(given that I have root permission)which could help me prevent this issue.

from resnext.pytorch.

ZhuFengdaaa avatar ZhuFengdaaa commented on June 6, 2024

Have you fixed that ? I am facing the same issue.

from resnext.pytorch.

penguinshin avatar penguinshin commented on June 6, 2024

I am also running into the same problem, although I am running everything on a CPU. I have more than enough memory (the error occurs when I'm using only 10G out of 32G)

from resnext.pytorch.

prlz77 avatar prlz77 commented on June 6, 2024

Hi! As @ZhuFengdaaa confirms, it seems a peak memory problem although I am not able to reproduce it. Again as @ZhuFengdaaa suggests, this seems to be linked with the number of threads (also see https://discuss.pytorch.org/t/guidelines-for-assigning-num-workers-to-dataloader/813/6).

from resnext.pytorch.

prlz77 avatar prlz77 commented on June 6, 2024

Another related thread ruotianluo/self-critical.pytorch#11

from resnext.pytorch.

henryccl avatar henryccl commented on June 6, 2024

OSError: [Errno 12] Cannot allocate memory sounds more like a RAM problem, not a GPU problem. Check you have enough RAM/SWAP, and the correct user permissions.

Why does this have to do with permissions?and what should i do with permissions?

from resnext.pytorch.

BlueskyFR avatar BlueskyFR commented on June 6, 2024

Why would some swap be needed? It slows down everything
I am having the same problem while trying to allocate 30 GB even though I have 1 TB free...

from resnext.pytorch.

jwr0218 avatar jwr0218 commented on June 6, 2024

This problem is come from CPU memory allocation. check CPU Ram Memory

from resnext.pytorch.

Related Issues (18)

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.