wooseoklee4 / AP-BSN

Official PyTorch implementation of "AP-BSN: Self-Supervised Denoising for Real-World Images via Asymmetric PD and Blind-Spot Network" in CVPR 2022.
MIT License
106 stars 12 forks source link

Inference issues #17

Closed TwilightArchon closed 3 months ago

TwilightArchon commented 3 months ago

Hello! Thanks for your excellent work! I'm running inference on a single image cropped from a video, and it worked just fine. However, I modified the base.py to let the model denoise a video, and there is cuda out of memory even if I cropped it to 512 512, while running on a single image of size 26881520 worked just fine. I extracted the frames from the video using cv2, and tried to denoise each frame using the model, but I got cuda out of memory. Do you have an idea of why there is cuda out of memory on the same image size, and one does not have the out of memory issue?

wooseoklee4 commented 3 months ago

Hi, sorry for the late reply.

I think there would be a difference on the input image size, assume that there is no modification on the model. Did you check the input image shape or try to denoise frames once at a time?

Best

TwilightArchon commented 3 months ago

Thank you! The problem is solved, instead of directly calling the video denoising method, I put it into "test" function in trainer, and it worked fine, and I have no idea what's the difference, since I called "before test" function.