Model.val() results get saved in /content/runs/detect/train2 folder

In Google Colab when I run model.val() after running model.train() the results get saved in the /content/runs/detect/train2 folder in the Colab notebook. I expected the validation results would get saved in a folder named val*, for example /content/runs/detect/val2.

Here’s my code:

!uv pip install ultralytics
!pip install roboflow

from roboflow import Roboflow
rf = Roboflow(api_key=[api_key_goes_here])
project = rf.workspace("conveyor-550m0").project("conveyor-hhrzw")
version = project.version(3)
dataset = version.download("yolov11")

from ultralytics import YOLO
model = YOLO("yolo11n.pt")

results = model.val(data="/content/conveyor-3/data.yaml", plots=True) # Results get saved in /content/runs/detect/val, as expected
train_results = model.train(data="/content/conveyor-3/data.yaml", epochs=1) # Results get saved in /content/runs/detect/train, as expected
results = model.val() # Results get saved in /content/runs/detect/train2

Is it expected that the results of the second model.val() call would get saved in a train* folder?

It’s a bug. You can run del model.overrides["name"] before running validation.

OK, thanks.

Has an issue been logged in GitHub for this? I searched through the Issues but couldn’t find it. I can log it if that would help.

I opened a PR with the fix

2 Likes

PR looks good! We should have this merged today and released under ultralytics v8.3.205

`ultralytics 8.3.205` Reset checkpoint arguments after training by Y-T-G · Pull Request #22286 · ultralytics/ultralytics · GitHub is now merged! Nice work @Toxite and thanks for bringing this up @John_Baker

Please update with pip install -U ultralytics and let us know if this solves your issue.

1 Like

Tested in my Colab notebook and confirmed it’s fixed. Thank you!

Awesome—thanks for confirming it’s fixed!

For future runs, model.val() after training will save under runs/detect/valN on ultralytics ≥ 8.3.205. If you want to control the output location, set project, name, or save_dir as described in the get_save_dir reference: get_save_dir documentation.