-
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
Does the thread pool need at least 2 threads when profiling is enabled? #5734
Comments
Bug Description In the process of using MediaPipe, I found that when only one Calculator is configured in the Graph and the PROFILING function is enabled, the Graph will not be able to process the data stream normally. The specific reason is that since there is only one Calculator configured, the size of the ThreadPool will only be allocated as 1, but the PROFILING function also relies on the thread pool (and is a long-running loop), so when the Graph receives the data stream, there is no thread to schedule the Calculator's Process function. Reproduction Steps
Observed Behavior The following output is observed, indicating that the program failed to execute properly (no threads available for scheduling) as there is no expected “Hello World!” message in the logs:
|
Of course, this issue is unlikely to occur under normal circumstances, as projects relying on MediaPipe usually consist of dozens of Calculators, making it highly improbable to have only one. I attempted to fix this issue; see: #5735 for details. Additionally, I am not particularly familiar with MediaPipe’s implementation, so the root cause I identified might be incorrect. Please pardon any inaccuracies. |
Could you please look into this issue? The relevant PR is available here #5735. Thank you!! |
Have I written custom code (as opposed to using a stock example script provided in MediaPipe)
None
OS Platform and Distribution
macOS 14.5 (Apple M1)
Mobile device if the issue happens on mobile device
No response
Browser and version if the issue happens on browser
No response
Programming Language and version
C++
MediaPipe version
No response
Bazel version
6.5.0
Solution
HelloWorld
Android Studio, NDK, SDK versions (if issue is related to building in Android environment)
No response
Xcode & Tulsi version (if issue is related to building for iOS)
No response
Describe the actual behavior
When there is only one Calculator and PROFILING is enabled, the Graph does not execute.
Describe the expected behaviour
The Graph should execute normally even when there is only one Calculator and PROFILING is enabled.
Standalone code/steps you may have used to try to get what you need
Detailed steps to reproduce can be found in the main body.
Other info / Complete Logs
No response
The text was updated successfully, but these errors were encountered: