Skip to content

Allow users to specify how to override a ClearML Task#10363

Merged
glenn-jocher merged 7 commits intoultralytics:masterfrom
thepycoder:bugfix/dont_reuse_last_task_id
Dec 5, 2022
Merged

Allow users to specify how to override a ClearML Task#10363
glenn-jocher merged 7 commits intoultralytics:masterfrom
thepycoder:bugfix/dont_reuse_last_task_id

Conversation

@thepycoder
Copy link
Copy Markdown
Contributor

@thepycoder thepycoder commented Dec 1, 2022

Context

As discussed here: #9865 (comment)
Thank you @mikel-brostrom for bringing this to light.

Changes

Add a new command line argument --reuse_last_task named such that it may later be reused by other loggers.
Not providing it, will make ClearML never override a task
Providing it, will allow ClearML to override the most recent task only if it doesn't have artifacts logged (model weights)
You can also add a custom Task ID as such --reuse_last_task fdf3586060bd4ef5bed277f64da646e9 to override a specific task.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

Enhanced ClearML Logger integration with YOLOv5 for task reuse.

📊 Key Changes

  • Added reuse_last_task_id parameter to ClearML logger initialization.

🎯 Purpose & Impact

  • 🚀 Purpose: Allows users to reuse the last task ID in ClearML if the existence of the task is acknowledged (controlled by exist_ok in options).
  • 💡 Impact: Users can continue logging from a previous run, making experiment tracking more flexible and less cluttered with redundant entries.

@glenn-jocher
Copy link
Copy Markdown
Member

@thepycoder thanks for the PR! Would it make sense to use the existing --exist-ok argument? This argument is meant to overwrite existing local logging directories, i.e. if these two commands will both log to yolov5/PROJECT/NAME locally.

python train.py --project PROJECT --name NAME
python train.py --project PROJECT --name NAME --exist-ok

Without --exist-ok a new unique NAME will be incremented for the second run, yolov5/PROJECT/NAME2

@glenn-jocher
Copy link
Copy Markdown
Member

@thepycoder argument is here, and is present in all files that contain --project and --name arguments:

yolov5/train.py

Lines 458 to 460 in 185d475

parser.add_argument('--project', default=ROOT / 'runs/train', help='save to project/name')
parser.add_argument('--name', default='exp', help='save to project/name')
parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')

@glenn-jocher glenn-jocher changed the title Allow users to specifcy how to override a ClearML Task. Allow users to specify how to override a ClearML Task Dec 1, 2022
@thepycoder
Copy link
Copy Markdown
Contributor Author

@glenn-jocher I have revised the PR to use the --exist-ok argument. Only downside now is that it cannot handle a specific task-id to override like discussed here.

Either you don't mind and we can merge this

Or I can extend the --exist-ok argument to be

parser.add_argument('--exist-ok',
                        nargs='?',
                        default=False,
                        const=True,
                        help=...

to not only allow true or false, but also string input for a specific task ID to override. WDYT?

@glenn-jocher
Copy link
Copy Markdown
Member

@thepycoder ok awesome! Let's try this first and then update if we get user requests for updating other tasks.

@glenn-jocher glenn-jocher merged commit f8539a6 into ultralytics:master Dec 5, 2022
@glenn-jocher
Copy link
Copy Markdown
Member

@thepycoder PR is merged. Thank you for your contributions to YOLOv5 🚀 and Vision AI ⭐

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

Successfully merging this pull request may close these issues.

2 participants