How to stop TensorFlow from multi-threading

大憨熊 提交于 2020-06-12 22:07:05

问题


I am writing code for NIST FRVT. NIST wants the program to run at max 2 threads(Only CPU, No GPU). I am using TensorFlow in my code but it always spawns much more than 2 threads. I tried this solution. It decreased the number of threads, but not up to 2

I'm getting this warning

[WARNING] We've detected that your software may be threading or using other multiprocessing techniques during template creation. The number of threads detected was 9 and it should be 2. Per the API document, implementations must run single-threaded. In the test environment, there is no advantage to threading, because NIST will distribute workload across multiple blades and multiple processes. We highly recommend that you fix this issue prior to submission.

NIST is calculating threads by top -H -b -n1 | grep validate11 | wc -l

Is there any way to force TensorFlow to use at max 2 threads?

Is there any TensorFlow version that will run on 2 threads?

(It is because of TensorFlow, I checked by removing TensorFlow part from the code)

tensorflow version 1.8.0

opencv version 3.4.1

g++ version 4.8.5

g++ -std=c++11

来源:https://stackoverflow.com/questions/60206113/how-to-stop-tensorflow-from-multi-threading

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!