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

unsufficient GPU storage? #13

Closed
JoniGlueck opened this issue Oct 7, 2021 · 4 comments
Closed

unsufficient GPU storage? #13

JoniGlueck opened this issue Oct 7, 2021 · 4 comments

Comments

@JoniGlueck
Copy link

Hello,
I'm currently testing your code on a new class I inserted to FSS-1000 (weldings on big machine parts). When trying to change several values, such as the image size in line 88 in test.py or the batch size, i constantly run into this error:

RuntimeError: CUDA out of memory. Tried to allocate 1.40 GiB (GPU 0; 7.79 GiB total capacity; 4.36 GiB already allocated; 448.50 MiB free; 5.44 GiB reserved in total by PyTorch)

I'm working on a nvidia RTX 3070ti with 8 Gigs of VRAM. I suppose this is because Pytorch manually manages storage allocation and there is not enough VRAM for processing larger images. However this is what i want to do, because I suppose larger images lead to better results in Few Shot Segmentation. So my question is, is there any way to increase FB-IoU and mIou on my own set of images or do I have to implement a completely new dataset on my own and do I have to train a new model to use it on this own set of images?

Thank you in advance and for your impressive work.

@juhongm999
Copy link
Owner

Note that the training of our model with batch size of 20 & image size of 400x400 requires about 20G memory.
What exactly were the batch and image sizes in your experiments?
Also, if the domain of your dataset is quite different from the provided FSS datasets (PASCAL, COCO, FSS-1000), results of the provided pretrained HSNet might be bad on your dataset.

@JoniGlueck
Copy link
Author

Thank you for your quick reply. I've experimented with several batch sizes from 1-5, image size is aimed at 1960x1960px . I trained your network again with my set of images as results where about 45-50 FBIoU with the pretrained model on Vgg16. Now I'm sitting at around 60-70 FBIoU with my new model (trained with 100 iterations). Another question I've come across is: does your hsnet work when no exact batch (containing sample images, masks, query image, query mask etc.) is provided? As our own query images are not supposed to have a mask with them.

@juhongm999
Copy link
Owner

You must have query masks to train the network with cross-entropy loss but you are not required to have query masks during testing. However, it's encouraged if you want to evaluate the model using mIoU metric.

@JoniGlueck
Copy link
Author

Thank you very much, that helps me out!

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