Skip to content

Instantly share code, notes, and snippets.

@rromanchuk
Last active February 3, 2024 07:00
Show Gist options
  • Save rromanchuk/db368169188310f2605d9477d6087c3b to your computer and use it in GitHub Desktop.
Save rromanchuk/db368169188310f2605d9477d6087c3b to your computer and use it in GitHub Desktop.
from clearml import Task, OutputModel
import os
cwd = os.getcwd()
print(cwd)
dataset_path = cwd
print(dataset_path)
KFOLD_SET = '2023-09-28_5-Fold_Cross-val'
SPLIT_NUM = "2"
Task.set_offline(offline_mode=True)
task = Task.init(project_name=KFOLD_SET, task_name=f"split_{SPLIT_NUM}")
output_model = OutputModel(task=task)
labels = {"foo": 0, "bar": 1}
output_model.update_labels(labels)
from ultralytics import RTDETR
model = RTDETR('yolov8n-rtdetr.yaml').load('rtdetr-l.pt')
dataset_yaml = f"{dataset_path}/{KFOLD_SET}/split_{SPLIT_NUM}/split_{SPLIT_NUM}_dataset.yaml"
print(dataset_yaml)
model.train(data=dataset_yaml,
project=f"/{dataset_path}/offline-training/{KFOLD_SET}_results/",
name=f"split_{SPLIT_NUM}_run",
)
task.close()
Task.set_offline(False)
Task.import_offline_session(task.get_offline_mode_folder())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment