Test set required even if run_test is False
Search before asking
- [x] I have searched the RF-DETR issues and found no similar bug report.
Bug
Hey y'all,
The functionality to perform a test run once the model finishes training has been added to the develop branch. I’m not sure if this was intentional, but in implementing this feature, a requirement for a test set was introduced, even when run_test is set to False. The error below illustrates this issue:
FileNotFoundError: [Errno 2] No such file or directory: 'dataset/test/_annotations.coco.json'
This seems to occur because dataset_test is being built and data_loader_test created regardless of the run_test flag’s value. According to the traceback, the failure happens at line 196 of main.py (see below):
dataset_test = build_dataset(image_set='test', args=args, resolution=args.resolution)
Also, if run_test is going to default to True, I believe there should be more graceful handling to inform the user that they need to either provide a test set or set run_test to False.
Let me know what y'all think.
Best, Rhys
Environment
RF-DETR: develop
Minimal Reproducible Example
- Download dataset with just a training and validation split.
- Train model with run_test = False
Additional
No response
Are you willing to submit a PR?
- [x] Yes, I'd like to help by submitting a PR!
Tests are also executed when run_test=False