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

<tfoot id='Ph9Qg'></tfoot>
    <bdo id='Ph9Qg'></bdo><ul id='Ph9Qg'></ul>
  • <small id='Ph9Qg'></small><noframes id='Ph9Qg'>

    <i id='Ph9Qg'><tr id='Ph9Qg'><dt id='Ph9Qg'><q id='Ph9Qg'><span id='Ph9Qg'><b id='Ph9Qg'><form id='Ph9Qg'><ins id='Ph9Qg'></ins><ul id='Ph9Qg'></ul><sub id='Ph9Qg'></sub></form><legend id='Ph9Qg'></legend><bdo id='Ph9Qg'><pre id='Ph9Qg'><center id='Ph9Qg'></center></pre></bdo></b><th id='Ph9Qg'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Ph9Qg'><tfoot id='Ph9Qg'></tfoot><dl id='Ph9Qg'><fieldset id='Ph9Qg'></fieldset></dl></div>

        <legend id='Ph9Qg'><style id='Ph9Qg'><dir id='Ph9Qg'><q id='Ph9Qg'></q></dir></style></legend>

        多處理一個for循環(huán)?

        Multiprocessing a for loop?(多處理一個for循環(huán)?)

        <small id='8t04x'></small><noframes id='8t04x'>

        1. <legend id='8t04x'><style id='8t04x'><dir id='8t04x'><q id='8t04x'></q></dir></style></legend>
            <tbody id='8t04x'></tbody>
          <tfoot id='8t04x'></tfoot>
            <bdo id='8t04x'></bdo><ul id='8t04x'></ul>

                  <i id='8t04x'><tr id='8t04x'><dt id='8t04x'><q id='8t04x'><span id='8t04x'><b id='8t04x'><form id='8t04x'><ins id='8t04x'></ins><ul id='8t04x'></ul><sub id='8t04x'></sub></form><legend id='8t04x'></legend><bdo id='8t04x'><pre id='8t04x'><center id='8t04x'></center></pre></bdo></b><th id='8t04x'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8t04x'><tfoot id='8t04x'></tfoot><dl id='8t04x'><fieldset id='8t04x'></fieldset></dl></div>
                  本文介紹了多處理一個for循環(huán)?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我有一個數(shù)組(稱為 data_inputs),其中包含數(shù)百個天文圖像文件的名稱.然后對這些圖像進行處理.我的代碼有效,并且需要幾秒鐘來處理每個圖像.但是,它一次只能做一個圖像,因為我正在通過 for 循環(huán)運行數(shù)組:

                  I have an array (called data_inputs) containing the names of hundreds of astronomy images files. These images are then manipulated. My code works and takes a few seconds to process each image. However, it can only do one image at a time because I'm running the array through a for loop:

                  for name in data_inputs:
                      sci=fits.open(name+'.fits')
                      #image is manipulated
                  

                  沒有理由我必須先修改圖像,所以是否可以利用我機器上的所有 4 個核心,每個核心在不同的圖像上通過 for 循環(huán)運行?

                  There is no reason why I have to modify an image before any other, so is it possible to utilise all 4 cores on my machine with each core running through the for loop on a different image?

                  我已閱讀有關(guān) multiprocessing 模塊的信息,但我不確定如何在我的情況下實現(xiàn)它.我熱衷于讓 multiprocessing 工作,因為最終我必須在 10,000 多張圖像上運行它.

                  I've read about the multiprocessing module but I'm unsure how to implement it in my case. I'm keen to get multiprocessing to work because eventually I'll have to run this on 10,000+ images.

                  推薦答案

                  你可以簡單地使用 multiprocessing.Pool:

                  You can simply use multiprocessing.Pool:

                  from multiprocessing import Pool
                  
                  def process_image(name):
                      sci=fits.open('{}.fits'.format(name))
                      <process>
                  
                  if __name__ == '__main__':
                      pool = Pool()                         # Create a multiprocessing Pool
                      pool.map(process_image, data_inputs)  # process data_inputs iterable with pool
                  

                  這篇關(guān)于多處理一個for循環(huán)?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  What exactly is Python multiprocessing Module#39;s .join() Method Doing?(Python 多處理模塊的 .join() 方法到底在做什么?)
                  Passing multiple parameters to pool.map() function in Python(在 Python 中將多個參數(shù)傳遞給 pool.map() 函數(shù))
                  multiprocessing.pool.MaybeEncodingError: #39;TypeError(quot;cannot serialize #39;_io.BufferedReader#39; objectquot;,)#39;(multiprocessing.pool.MaybeEncodingError: TypeError(cannot serialize _io.BufferedReader object,)) - IT屋-程序員軟件開
                  Python Multiprocess Pool. How to exit the script when one of the worker process determines no more work needs to be done?(Python 多進程池.當其中一個工作進程確定不再需要完成工作時,如何退出腳本?) - IT屋-程序員
                  How do you pass a Queue reference to a function managed by pool.map_async()?(如何將隊列引用傳遞給 pool.map_async() 管理的函數(shù)?)
                  yet another confusion with multiprocessing error, #39;module#39; object has no attribute #39;f#39;(與多處理錯誤的另一個混淆,“模塊對象沒有屬性“f)

                      <tfoot id='gma05'></tfoot>
                            <tbody id='gma05'></tbody>
                          <i id='gma05'><tr id='gma05'><dt id='gma05'><q id='gma05'><span id='gma05'><b id='gma05'><form id='gma05'><ins id='gma05'></ins><ul id='gma05'></ul><sub id='gma05'></sub></form><legend id='gma05'></legend><bdo id='gma05'><pre id='gma05'><center id='gma05'></center></pre></bdo></b><th id='gma05'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='gma05'><tfoot id='gma05'></tfoot><dl id='gma05'><fieldset id='gma05'></fieldset></dl></div>
                          • <bdo id='gma05'></bdo><ul id='gma05'></ul>
                            <legend id='gma05'><style id='gma05'><dir id='gma05'><q id='gma05'></q></dir></style></legend>

                            <small id='gma05'></small><noframes id='gma05'>

                            主站蜘蛛池模板: 亚洲成人免费观看 | 欧美一级在线观看 | 中文字幕在线观看不卡 | 日本在线观看 | 国产三级在线播放 | 亚洲欧美日韩国产 | 日韩视频在线播放 | 中国极品少妇xxxx做受 | 狠狠操天天操 | 亚洲视频区 | 日韩美女在线 | 欧美日韩综合网 | 久热伊人 | 国产这里只有精品 | 97久久精品 | 99久久久国产精品免费蜜臀 | 特大黑人巨交吊性xxxx视频 | 高hnp失禁3p小公主 | 最新av在线 | av在线免费观看网站 | 亚洲砖区区免费 | 天天干天天曰 | 欧美一级片在线观看 | 久久久久久国产精品 | 国产日韩欧美综合 | 日韩视频一区 | 黄色三级视频网站 | www.亚洲国产 | 欧美日韩国产中文字幕 | 日本一级大片 | 亚洲一区二区三区在线播放 | 午夜视频在线免费观看 | 国产无遮挡又黄又爽免费网站 | 亚洲成人免费 | 免费三片在线观看网站v888 | 成人看| 日韩精品视频在线播放 | av片在线观看 | 亚洲成人免费 | 欧美精品在线免费观看 | 久久黄色一级片 |