久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何阻止 TensorFlow 使用多線程

How to stop TensorFlow from multi-threading(如何阻止 TensorFlow 使用多線程)
本文介紹了如何阻止 TensorFlow 使用多線程的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

我正在為 NIST FRVT 編寫(xiě)代碼.NIST 希望程序以最多 2 個(gè)線程運(yùn)行(只有 CPU,沒(méi)有 GPU).我在我的代碼中使用 TensorFlow,但它總是產(chǎn)生超過(guò) 2 個(gè)線程.我嘗試了這個(gè)解決方案.它減少了線程數(shù),但沒(méi)有達(dá)到 2

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

我收到此警告

[警告] 我們檢測(cè)到您的軟件在模板創(chuàng)建期間可能正在線程化或使用其他多處理技術(shù).檢測(cè)到的線程數(shù)為 9,應(yīng)該為 2.根據(jù) API 文檔,實(shí)現(xiàn)必須運(yùn)行單線程.在測(cè)試環(huán)境中,線程沒(méi)有優(yōu)勢(shì),因?yàn)?NIST 會(huì)在多個(gè)刀片和多個(gè)進(jìn)程之間分配工作負(fù)載.我們強(qiáng)烈建議您在提交前解決此問(wèn)題.

[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 正在通過(guò) top -H -b -n1 | 計(jì)算線程數(shù)grep validate11 |wc -l

有沒(méi)有辦法強(qiáng)制 TensorFlow 使用最多 2 個(gè)線程?

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

是否有可以在 2 個(gè)線程上運(yùn)行的 TensorFlow 版本?

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

(這是因?yàn)門(mén)ensorFlow,我通過(guò)從代碼中刪除TensorFlow部分來(lái)檢查)

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

tensorflow 1.8.0 版

tensorflow version 1.8.0

opencv 3.4.1 版

opencv version 3.4.1

g++ 4.8.5 版

g++ version 4.8.5

g++ -std=c++11

g++ -std=c++11

推薦答案

參考以下來(lái)源,似乎無(wú)法在 1 或 2 個(gè)線程上運(yùn)行 TensorFlow.

With reference to the following sources, it looks like there is no possibility to run TensorFlow on 1 or 2 threads.

  • https://github.com/tensorflow/tensorflow/issues/33627
  • https://github.com/tensorflow/tensorflow/issues/42510
  • https://github.com/theislab/batchglm/issues/27
  • 使用腳本變量 OMP_NUM_THREADS在程序源文件中
  • 使用 C 更改 Tensorflow 推理的線程數(shù)API

我提交了具有超過(guò) 6 個(gè)線程的 NIST-FRVT 實(shí)現(xiàn),NIST 接受了這一點(diǎn).6 個(gè)線程中只有 1 個(gè)在運(yùn)行,其余線程處于睡眠模式.

I submitted my implementation of NIST-FRVT having more than 6 threads, and NIST accepted that. Only 1 out of 6 threads were running and the rest of the threads were in sleeping mode.

這篇關(guān)于如何阻止 TensorFlow 使用多線程的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Assertion failed (size.widthgt;0 amp;amp; size.heightgt;0)(斷言失敗(size.width0 amp;amp; size.height0))
Rotate an image in C++ without using OpenCV functions(在 C++ 中旋轉(zhuǎn)圖像而不使用 OpenCV 函數(shù))
OpenCV: process every frame(OpenCV:處理每一幀)
Why can#39;t I open avi video in openCV?(為什么我不能在 openCV 中打開(kāi) avi 視頻?)
OpenCV unable to set up SVM Parameters(OpenCV 無(wú)法設(shè)置 SVM 參數(shù))
Convert a single color with cvtColor(使用 cvtColor 轉(zhuǎn)換單一顏色)
主站蜘蛛池模板: 国内精品一区二区 | 中国农村毛片免费播放 | 日皮视频在线观看 | 在线观看的av网站 | 国产一区欧美 | 国产成人综合视频 | 一级黄片毛片 | 一级欧美一级日韩 | 国产乱码一区二区 | 国产麻豆91| 久久久久久久久久久久久久久久久久久 | 精品国产91| 精品免费在线 | 精品免费国产 | 日皮视频免费看 | 伊人精品综合 | 亚洲iv一区二区三区 | 免费av播放 | 蜜臀久久99精品久久久久久宅男 | 日韩精品久久久久久久 | 国产精品一区二区三区免费 | 国产一区二区三区免费视频 | 婷婷六月天 | 伊人影院久久 | 96久久 | 亚洲激情自拍 | 久久精品一区二区三区四区 | 金银在线 | 黄色日本视频 | 久久久久亚洲精品 | 日韩免费精品 | 日本精品视频 | 一区二区三区国产视频 | 解开岳的丰满奶罩bd | 色婷婷一区 | 日韩黄色在线观看 | 午夜精品久久久久久久99黑人 | 亚洲第一伊人 | 日韩小视频在线观看 | 欧美一区不卡 | 色婷婷视频在线观看 |