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

CUDA out of memory. But why though? #44

Closed
pedrovivash opened this issue Feb 8, 2022 · 2 comments
Closed

CUDA out of memory. But why though? #44

pedrovivash opened this issue Feb 8, 2022 · 2 comments

Comments

@pedrovivash
Copy link

pedrovivash commented Feb 8, 2022

I'm assuming the response to this will be something along the lines: "turn off GPU." Yet, I find it hard to believe that using the same hardware I've used with DaVinci Resolve (which can denoise an unlimited amount of video frames on the fly using motion estimation), my measly 80kb jpg files (sure 10717 frames worth) are failing with fastDVDnet. Well:

Traceback (most recent call last): File "test_fastdvdnet.py", line 166, in test_fastdvdnet(**vars(argspar)) File "test_fastdvdnet.py", line 98, in test_fastdvdnet max_num_fr=args['max_num_fr_per_seq']) File "C:\Users\pedro\Desktop\CLONE\fastdvdnet\utils.py", line 127, in open_sequence expand_axis0=False) File "C:\Users\pedro\Desktop\CLONE\fastdvdnet\utils.py", line 185, in open_image img = normalize(img) File "C:\Users\pedro\Desktop\CLONE\fastdvdnet\utils.py", line 307, in normalize return np.float32(data/255.) numpy.core._exceptions.MemoryError: Unable to allocate 23.7 MiB for an array with shape (3, 1080, 1920) and data type float32

This is utilizing 8GB VRAM. I guess I'm confused about how the program handles the memory allocation? It's all way over my head...

And to be clear, I'm avoiding solutions like Resolve. I'd prefer to use open-source, especially since noise reduction benefits from tinkering. I also like that you all have made this project otherwise straightforward to work with.

@m-tassano
Copy link
Owner

My impression is that your limiting factor here is not the GPU memory, but your RAM memory. The testing script loads all the input frames before running the CNN model. If I understand correctly, you want to denoise a sequence with 10717 frames, but your system does not have enough RAM memory to load all of them.
You could try slicing the sequence to denoise and load less frames at a time. You could as well for example modify the testing script so that it loads the input frames in a sliding window fashion.

@pedrovivash
Copy link
Author

Just saw this, thank you! I'll take a look at the script in the future. Cheers.

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

2 participants