久久久久久久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循環?

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

        <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循環?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

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

                  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 循環運行?

                  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?

                  我已閱讀有關 multiprocessing 模塊的信息,但我不確定如何在我的情況下實現它.我熱衷于讓 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
                  

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

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

                  相關文檔推薦

                  What exactly is Python multiprocessing Module#39;s .join() Method Doing?(Python 多處理模塊的 .join() 方法到底在做什么?)
                  Passing multiple parameters to pool.map() function in Python(在 Python 中將多個參數傳遞給 pool.map() 函數)
                  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() 管理的函數?)
                  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'>

                            主站蜘蛛池模板: 色爱综合网 | 精品国产一区二区久久 | 99精品电影| 成人影院在线观看 | 91久久综合亚洲鲁鲁五月天 | 在线不卡视频 | 午夜激情影院 | 国产一区二区在线免费播放 | 欧美一区2区三区4区公司二百 | 中文字幕免费观看 | 91久久久www播放日本观看 | 麻豆精品国产91久久久久久 | 一级黄色片日本 | 91精品国产91久久久久久密臀 | 欧美成人在线网站 | 久久视频精品 | 日韩视频在线一区二区 | 91电影 | 精品成人在线 | 久热电影| 黄色网址在线免费观看 | 日韩高清三区 | 中国一级大毛片 | 国产精品精品视频一区二区三区 | 欧美一区二区三区小说 | 亚洲第一女人av | 午夜视频网| 亚洲资源站 | www.午夜| 日韩高清国产一区在线 | 天天干天天插天天 | 午夜免费网站 | 午夜免费网站 | 99精品在线免费观看 | 欧美日韩一区二区电影 | 香蕉视频一区二区 | 日韩视频精品在线 | 国产成人精品午夜视频免费 | 欧美视频成人 | 亚洲精色 | 成人在线看片 |