Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error code 12 (Cannot allocate memory) #3

Open
DaWe35 opened this issue Dec 15, 2019 · 8 comments
Open

Error code 12 (Cannot allocate memory) #3

DaWe35 opened this issue Dec 15, 2019 · 8 comments

Comments

@DaWe35
Copy link

DaWe35 commented Dec 15, 2019

python3 visualize.py --song ooo002.mp3 --resolution 512

VPS:

  • 6 core
  • 16 GB RAM
  • 50 GB+ free SSD sapce
  • Ubuntu 18.04
Generating frames

  0%|                                                                                                                                                                 | 0/14 [00:00<?, ?it/s]Traceback (most recent call last):
  File "visualize.py", line 382, in <module>
    output = model(noise_vector, class_vector, truncation)
  File "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/user/.local/lib/python3.6/site-packages/pytorch_pretrained_biggan/model.py", line 295, in forward
    z = self.generator(cond_vector, truncation)
  File "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/user/.local/lib/python3.6/site-packages/pytorch_pretrained_biggan/model.py", line 239, in forward
    z = layer(z, cond_vector, truncation)
  File "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/user/.local/lib/python3.6/site-packages/pytorch_pretrained_biggan/model.py", line 190, in forward
    x = self.conv_3(x)
  File "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 541, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 345, in forward
    return self.conv2d_forward(input, self.weight)
  File "/home/user/.local/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 342, in conv2d_forward
    self.padding, self.dilation, self.groups)
RuntimeError: [enforce fail at CPUAllocator.cpp:64] . DefaultCPUAllocator: can't allocate memory: you tried to allocate 4026531840 bytes. Error code 12 (Cannot allocate memory)

  0%|                                                                                                                                                                 | 0/14 [01:36<?, ?it/s]
@mhsharifi96
Copy link

same problem ! :/
when try run occur error can't allocate memory

what can I solve it?

@didinium
Copy link

have the same problem over here

@illtellyoulater
Copy link

illtellyoulater commented Mar 5, 2023

same thing here, anyone manged to fix this?

EDIT: Ah ok, just saw there's a PR that could fix it.

@didinium
Copy link

didinium commented Mar 5, 2023 via email

@illtellyoulater
Copy link

illtellyoulater commented Mar 6, 2023

I could make it work using this updated fork which includes this and other fixes, in addition to a couple more features: https://github.com/zlattala/deep-music-visualizer

@DaWe35
Copy link
Author

DaWe35 commented Mar 6, 2023

Thanks @illtellyoulater, it works fine for me, except is uses 0% of my GPU. How can I make it run on GPU instead of CPU?

@illtellyoulater
Copy link

illtellyoulater commented Mar 8, 2023

@DaWe35

If you are using the code from the forked repository then you should open an issue about that on the forked repository.

That said, I am not observing the issue you are reporting, but usually when you see the CPU being used in place of the GPU it means you installed a wrong version of torch. To make sure everything works as expected please make sure to follow the forked repository package requirements and installing instructions.

@DaWe35
Copy link
Author

DaWe35 commented Mar 9, 2023

You're right, but I don't think this issue is related to the new fork. With conda, I was able to use my GPU, so yes, it was something with the version of python/torch/env.
My next question is if there is a 1080p/4k pretrained model, and if not, how do I train it? 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants