# Steps for training This is a step by step guide to train the model, see [steps for data versioning](./tutorial_data_versioning.md) before this one. 1. Unzip data using the command: ```bash unzip data/data.zip ``` 2. Inside the Ultralytics folder, change it so runs are saved in the models folder of this repository. ```bash cd /home/user/.config/Ultralytics sudo vim settings.json ``` Do the following changes in settings.json: ```Json "datasets_dir": "/home/user/your_path/repo-name", "weights_dir": "/home/user/your_path/repo-name/models/weights", "runs_dir": "/home/user/your_path/repo-name/models/runs", ``` 3. In the root folder of the repository, start Mlflow: ```Bash mlflow ui --backend-store-uri ./models/runs/mlflow ``` ![empty_mlfow](./_static/imgs/empty_mlflow.png) 4. In another terminal, train model: ```Bash cd src/ python3 train.py ``` This command will train the model and also save the best.onnx from the trained model inside the model S3 bucket. It will erase the file best.onnx from the bucket if it already exists. If you would like to use another YOLO model, you can run the following command (in the root of the repo): ```Bash python3 data/s3_bucket.py --file_path /absolute_train_path/weights/best.onnx ``` 5. Train again, changing hyperparameters if necessary. ![mlflow_working](./_static/imgs/mlflow_working.png) 6. All runs will be saved in the folder models/runs ![mlflow_working_runs](./_static/imgs/mlflow_working_runs.png)