Skip to content

RFDETRSegPreview validation calls are extremely slow. Can we speed up? #416

@Abdul-Mukit

Description

@Abdul-Mukit

Search before asking

  • I have searched the RF-DETR issues and found no similar feature requests.

Description

I have a dummy dataset of train:val = 1500 : 200 size. On this dataset, with a batch size of 16 on a A100-80GB GPU,
1 epoch (1500 images) of training takes a total time: 0:06:20 (3.9606 s / it)
1 epoch (200 images) of validation takes a total time: 0:07:34 (34.9950 s / it)
That is nearly 10x slower compared to training.

This is complicated by RFDETR running two validation calls. Once with the base model. Another time with the EMA model. So I spend 6 minutes training one epoch. Then I wait for another 15 minutes to finish the validation calls and resume training again. This makes the training process extremely slow.

To compare with YOLOv8sSeg, on the same GPU, the validation call on 2800 images takes 34 seconds or less. With a batch size of 160.

I noticed that during validation calls, the postprocessor upsamples masks to the original input image size of the dataset. Is that really necessary? But even with that turned off, I believe there is something wrong with the validation call. It is way too slow.

Can we please optimize validation calls?

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions