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

Out of memory! #11

Closed
primepake opened this issue Dec 3, 2024 · 23 comments
Closed

Out of memory! #11

primepake opened this issue Dec 3, 2024 · 23 comments

Comments

@primepake
Copy link

I used the same config with your training but got OOM! Are you sure it's correct?

@LorenzoAgnolucci
Copy link
Collaborator

Hi! What GPU are you using?

@primepake
Copy link
Author

I'm using H100 with 80GB

@LorenzoAgnolucci
Copy link
Collaborator

LorenzoAgnolucci commented Dec 3, 2024

I see. Are you training the model with the default resolution?

@primepake
Copy link
Author

yes 512x512? have you tried with accelerator? I trained with it and got OOM

@LorenzoAgnolucci
Copy link
Collaborator

By default, the --train-patch-size parameter is set to 128. I've never tried using accelerator, sorry.

@primepake
Copy link
Author

I just started the training but I'm checking your code, it only input with the shape
imgs_lq.shape, imgs_gt.shape, imgs_ref.shape: torch.Size([2, 5, 3, 128, 128]) torch.Size([2, 5, 3, 128, 128]) torch.Size([2, 5, 3, 128, 128])
so why in the inference you run with 512 image?

@primepake
Copy link
Author

can you share the chart of you loss values?
image

@LorenzoAgnolucci
Copy link
Collaborator

In image and video restoration, training with a patch size smaller than the test one is quite a common way to save memory during training. On which dataset are you training? Is it the one of the paper or a custom one?

@primepake
Copy link
Author

primepake commented Dec 4, 2024

I'm training with car dataset

@LorenzoAgnolucci
Copy link
Collaborator

Can I see a video example somewhere? Is it public?

@primepake
Copy link
Author

yes! it recorded around the car
https://www.kaggle.com/datasets/tapakah68/videos-around-cars

@LorenzoAgnolucci
Copy link
Collaborator

What's the end goal of your work? Because the videos don't seem degraded with artifacts similar to those considered in our paper.

@primepake
Copy link
Author

I want to increase the quality of the image by degradation ground truth image while training.

@LorenzoAgnolucci
Copy link
Collaborator

What kind of degradation? Our model is designed for analog video restoration, I'm not sure it's suitable for your purpose.

@primepake
Copy link
Author

it's simple degradations (gaussian noise, blur gaussian, blur part of car, downsample_upsample) in video

@LorenzoAgnolucci
Copy link
Collaborator

How did you determine the reference frames? Did you use the standard textual prompts or did you change them to fit your needs?

By the way, I'm closing the issue since the out of memory problem is now solved.

@primepake
Copy link
Author

I just select random from dataset. Do you if we select different views it will support that?

@LorenzoAgnolucci
Copy link
Collaborator

Why should random frames represent reference frames for the restoration? In the paper, we devised a specific methodology for analog videos. You should try to adjust that for your needs if you want to use our model for your purpose.

@primepake
Copy link
Author

I'm just thinking while training we can select random then the model can learn better after that, in the inference stage we can choose reference based on CLIP score.

@LorenzoAgnolucci
Copy link
Collaborator

I've never tried it, so I'm not sure if it will work (or not)

@primepake
Copy link
Author

Thanks! Can you provide your training chart?

@LorenzoAgnolucci
Copy link
Collaborator

I don't have the charts anymore, but I have the values of the losses at the end of the training: about 3.2 for the pixel_loss, and about 4.6 for the perceptual_loss. However, since you are using a different training dataset, I don't think these values are useful for you. But from what I remember, the profiles of the losses were similar to your charts.

@primepake
Copy link
Author

Thanks a lot!

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