-
Notifications
You must be signed in to change notification settings - Fork 105
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
Attempting to copy inputs of <function pairwise_iou at > to CPU due to CUDA OOM #90
Comments
I met the same situation. I find the eval batch is always 1, but I didn't solve this problem. |
You can try setting the cfg.INPUT.IMAGE_SIZE parameter to 512, but this may result in a decrease in accuracy. |
I resolved the issue by reducing the resolution of the original image |
请问降低分辨率会影响精度吗 |
it seems that during evaluation the image and inference output will be interpolated to the size of the original image, so this operation is only useful during model.train() |
The dataset mapper used for coco instance segmentation task during evaluation is coco_instance_new_baseline_dataset_mapper.py, which takes the original image as input for model. This will lead to CUDA OOM if the original image size is too large, e.g. 3000*4000. This issue can be solved by apply a different dataset mapper for the dataloader, you can define a transform for input image and apply the transform to your image and annotation inside the mapper, such as the authors did in detr_dataset_mapper.py:
Then the CUDA OOM issue should be solved already. |
While training a custom dataset in COCO format, we are running out of memory on evaluation and jumping to the CPU.
Does detectron2's algorithm build the test dataloader differently than the train, and puts all mini-batches on the gpu instead of just loading a mini-batch on each gpu?
The images of val2017 directory in my custom dataset is 22GB in size. I know that the val2017 image size of Coco is about 800MB, but on the server GPU I use, Coco runs fine, but the custom dataset copies the model to the CPU due to insufficient memory on the GPU as shown below.
In DINO, this dataset ran fine, but in MASK DINO, I noticed the above issue.
Is there a way to fix this?
The text was updated successfully, but these errors were encountered: