Train a "clean" Yolov12 model (not pre-trained) on a custom dataset

Hi,
Been strugling with finding the “clean”, not-pre-trained Yolov12 .yaml files in order to train a yolo model from scratch.
ChatGPT and google, etc didnt provided working solution.
the files are not on the Yolov12 seperated github as well.
please help with understand where can i get the different yolov12 flavors .yaml files for the un-trained models.
ref to files or Simple python code with example will be much appriciated,
Thanks,
Mac_J

You just provide YAML filename. Ultralytics automatically uses the correct file. You don’t need to download it manually.

model = YOLO("yolo12n.yaml")

1 Like

Thank you!

You’re welcome!

We generally advise against using YOLO12 due to training instability, high memory consumption, and significantly slower CPU speeds. For all use cases, we recommend using YOLO11, which provides state-of-the-art performance and stability.

To train a new model from scratch on a custom dataset, you can simply use the model’s .yaml file. Here is a short example using YOLO11:

from ultralytics import YOLO

# Build a new YOLO11n model from its configuration file
model = YOLO("yolo11n.yaml")

# Train the model on your custom dataset
results = model.train(data="path/to/your_dataset.yaml", epochs=100, imgsz=640)

You can find more information in our documentation on how to train a model. Hope this helps