ultralytics / ultralytics

NEW - YOLOv8 🚀 in PyTorch > ONNX > OpenVINO > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
28.7k stars 5.7k forks source link

Change mosaic_min_rate #14260

Open ZooKangaroo opened 2 months ago

ZooKangaroo commented 2 months ago

Search before asking

Question

How can I change the hyp of mosaic_min_ratio when training? I found that there's not the hyp. Should I download all the codes, deactivate the python-envs, and change it in the funcion? Is there any easier way to set the parameter in "yolo train model=.pt data=.yaml mosaic=1"

I found that every time in train_batch.jpg, some boxes with too small size also exist, which should be ignored

Additional

image

No response

glenn-jocher commented 2 months ago

Hello,

Thank you for reaching out! You can indeed adjust the mosaic_min_ratio hyperparameter without needing to download and modify the source code directly. Instead, you can specify this parameter in your training command using the --hyp argument to point to a custom YAML file where you define your hyperparameters.

Here's a step-by-step guide:

  1. Create a Custom Hyperparameters File: Create a YAML file (e.g., custom_hyp.yaml) and include the mosaic_min_ratio parameter along with any other hyperparameters you wish to customize. For example:

    mosaic_min_ratio: 0.2  # Adjust this value as needed
    # Add other hyperparameters here
  2. Run the Training Command: Use the --hyp argument to specify your custom hyperparameters file in the training command:

    yolo train model=your_model.pt data=your_data.yaml hyp=custom_hyp.yaml

This approach allows you to easily modify hyperparameters without altering the core codebase or environment.

Additionally, if you haven't already, please ensure you are using the latest version of the Ultralytics packages to benefit from the latest features and bug fixes.

If you encounter any further issues or have more questions, feel free to ask. Happy training! 🚀

github-actions[bot] commented 1 month ago

👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.

For additional resources and information, please see the links below:

Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!

Thank you for your contributions to YOLO 🚀 and Vision AI ⭐