Develop Custom Training Templates
TOC
Template Structure Overview
A typical custom training template should include the necessary configuration files and training scripts. Taking the YOLOv5 object detection training template (for example, training-object-detection-ultralytics) as an example, its directory structure usually includes:
- Core training script: Handles the model training logic.
- Utility scripts: Provide helper functions to interact with the platform.
- Configuration files: Specify the training environment and parameters.
Core Responsibilities and Script Requirements
The user's primary task is to implement a custom training script (usually named run.sh). To ensure that your custom script can be correctly integrated and coordinated with Alauda AI platform sub-tasks, please strictly follow the three key requirements below:
Import Platform Utility Scripts:
Your main training script (e.g., run.sh) must execute the following commands at the beginning to load the platform-provided utility functions:
Purpose: The util.sh script encapsulates standard platform capabilities such as parameter retrieval, path resolution, and logging. Please refer to the provided examples to ensure your script correctly leverages the built-in parameters and control flow of the system.
Model Output Path Notification Mechanism:
Before the training function exits normally, you must execute the following command to pass the output path of the model to subsequent tasks (such as model upload tasks):
Purpose: This step is the key mechanism by which the platform identifies and collects the final training outputs. Please ensure that the path is constructed correctly (base model path + relative output directory).
Script Execution Permissions:
Before uploading your template to the GitLab model repository, ensure all Bash script files—especially run.sh and any dependent .sh files—have executable permissions.
Action: Set permissions by running chmod +x *.sh or apply the command to specific files as needed.
Key Parameter Reference Table
When implementing your training template, please carefully review the table below to understand the core parameters involved in the template directory structure and scripts, as well as their meanings. These parameters define how the base model, dataset, and platform environment are connected. Recommendation: Before you start writing, be sure to study the official sample templates we provide to better understand how parameters are invoked and used in real training workflows.