-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiprocessing problem when training YOLOV8 on dataset #10475
Comments
Hey there! It looks like the issue you're encountering is related to how the multiprocessing module is initialized in Windows environments. Python's multiprocessing requires a specific if-statement guard in scripts that are using the multiprocessing functionalities to avoid recursion in Windows. To correct this issue in your code, you'll want to wrap your training call in an from ultralytics import YOLO
if __name__ == '__main__':
model = YOLO('yolov8n.pt')
metrics = model.train(data="datasets/deneme-5k/data.yaml", device="cuda", batch=2) Essentially, this ensures that your training only begins if your script is run as the main program. It prevents the recursive importing that's happening when using multiprocessing on Windows. Give this a try, and it should resolve the multiprocessing error you're seeing. Let me know how it goes! 🚀 |
thank you ,that is working |
Great to hear that the solution worked for you! If you encounter any more issues or have further questions, feel free to reach out. Happy training with YOLOv8! 🚀 |
Search before asking
Question
I'm trying to train a yolov8 model using ultralytics module.
My code is like this:
I'm using this dataset here: https://universe.roboflow.com/rizwan-babar/ms_thesis/dataset/10 which has around 5k images.
Everything seems to be running fine but for some reason it gives an multiprocessing error at the start. In a similiar error they said that there must be enough ram but I don't think this is the case since at the highest memory usage I had around 4gb free ram and 3.3 gb free vram.
Any help would be appreciated, thanks.
Additional
Here's the log:
The text was updated successfully, but these errors were encountered: