-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
A question about validation set drawing image results #13101
Comments
👋 Hello @Love-syntacticSugar, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered. If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it. If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results. Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users. InstallPip install the pip install ultralytics EnvironmentsYOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
StatusIf this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit. |
@Love-syntacticSugar hello! It's great to see you've done a thorough investigation into the threading issue with the Setting the Regarding security concerns, using a single thread by setting If you prefer not to modify the threading behavior, another approach could be to ensure that all data passed between threads is properly synchronized or that thread-safe data structures are used. However, this might require more in-depth changes to the codebase. If the current solution of setting Keep exploring and feel free to reach out if you have more questions! 🚀 |
👋 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 ⭐ |
Search before asking
Question
When I used the validation method on the DOTAv1.0 validation set, I got incorrect image results either on my own computer or on the kaggle cloud server. Here's my running code:
With batch_size of 2, this is what I get:
![image](https://private-user-images.githubusercontent.com/82279895/333531284-7fb035a1-94f1-449e-aaf8-af5b1785c568.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NjQ4NjQsIm5iZiI6MTcyMDQ2NDU2NCwicGF0aCI6Ii84MjI3OTg5NS8zMzM1MzEyODQtN2ZiMDM1YTEtOTRmMS00NDllLWFhZjgtYWY1YjE3ODVjNTY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA4VDE4NDkyNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY2N2ZhNjdhZTk5N2Y5MDBjN2JkZjA0MTdhYjQ3NDk2OTliOWZlYTNjODRkYzExZTlkNzc2MGU1OWI5Mzk0Y2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.gKpKJMfFwHGJfWz7O1aGyQFxPLv1bzrFASknPPnJXrE)
![image](https://private-user-images.githubusercontent.com/82279895/333532215-95240e67-9513-45f1-a107-c6b31db8e609.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NjQ4NjQsIm5iZiI6MTcyMDQ2NDU2NCwicGF0aCI6Ii84MjI3OTg5NS8zMzM1MzIyMTUtOTUyNDBlNjctOTUxMy00NWYxLWExMDctYzZiMzFkYjhlNjA5LnBuZz9YLUF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NmM2YzkwN2E5NmY5MWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0OXOWs2aA7iQU4jZS220r9z2ZIoDv6JRE_HzC51N89U)
After looking at the v8 source code in detail, I used pycharm to debug, placing breakpoints at key code points, as shown below:
After debugging, I found that the result was surprisingly normal! As shown in the picture below:
Why did this situation occur? After thinking for a long time, I found that the
plot_images
method used the decorator@threaded
in theplot_val_samples
method. I attributed the problem to thread-related reasons, so I passed thethreaded=False
parameter to theplot_val_samples
method but I didn't do the same thing forplot_predictions
method. I found that the result did become correct!!It seems that dual threading works correctly (one thread for the main method and another for the plot_predictions method). However, with three threads (main + plot_val_samples + plot_predictions), errors occur.But fortunately, the results are normal now.However, due to my limited knowledge of thread-related issues, I am not sure what consequences this approach will bring. It is well known that the introduction of threads can ensure the safety of the program. I also understand that the introduction of threads here is to separate the main program from the drawing of images, and to speed up the execution of the main program. But when I set the
threaded
parameter toFalse
, it will share a thread. Besides the slowdown, could there be potential security issues? I don't care about the speed issue, but I care about the security issue.In addition, besides setting
threaded=False
, are there any other methods to solve this problem?Additional
Furthermore, it is worth mentioning that: In order to produce the desired image results, I made some modifications to the v8 source code. However, I also tested on the original v8 source code, and encountered the same issue mentioned above. So, I believe the problem is not caused by my personal code modifications.
The text was updated successfully, but these errors were encountered: