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

      • <bdo id='6u5O0'></bdo><ul id='6u5O0'></ul>

      <legend id='6u5O0'><style id='6u5O0'><dir id='6u5O0'><q id='6u5O0'></q></dir></style></legend>
    1. <small id='6u5O0'></small><noframes id='6u5O0'>

      <tfoot id='6u5O0'></tfoot>

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

        Windows 上的多處理中斷

        Multiprocessing on Windows breaks(Windows 上的多處理中斷)

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

                1. <small id='fRaRI'></small><noframes id='fRaRI'>

                2. 本文介紹了Windows 上的多處理中斷的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我在 Linux 上使用 Python 進行開發,但從未真正見過 Windows 出現此類問題.我正在使用 multiprocessing 庫來加速計算,這對我在 Linux 上非常有效.

                  I develop with Python on Linux and have never really seen this sort of problem with Windows. I'm using the multiprocessing library to speed up computations, which works very well for me on Linux.

                  然而,在 Windows 上,事情并不順利:

                  On Windows, however, things don't run as smoothly:

                   * [INFO] Parsing 1 file using 2 threads
                  
                  Traceback (most recent call last):
                    File "main.py", line 170, in <module>
                      master = ParsingMaster(parser, list(input_file), output_list, threads=num_threads)
                  Traceback (most recent call last):
                    File "main.py", line 39, in __init__
                    File "<string>", line 1, in <module>
                      self.input_process.start()
                    File "C:Python26libmultiprocessingforking.py", line 342, in main
                    File "C:Python26libmultiprocessingprocess.py", line 104, in start
                          self._popen = Popen(self)
                  self = load(from_parent)
                    File "C:Python26libmultiprocessingforking.py", line 239, in __init__
                    File "C:Python26libpickle.py", line 1370, in load
                      dump(process_obj, to_child, HIGHEST_PROTOCOL)
                    File "C:Python26libmultiprocessingforking.py", line 162, in dump
                      ForkingPickler(file, protocol).dump(obj)
                    File "C:Python26libpickle.py", line 224, in dump
                      return Unpickler(file).load()
                      self.save(obj)
                   File "C:Python26libpickle.py", line 858, in load
                    File "C:Python26libpickle.py", line 331, in save
                      self.save_reduce(obj=obj, *rv)
                    File "C:Python26libpickle.py", line 419, in save_reduce
                      dispatch[key](self)
                    File "C:Python26libpickle.py", line 880, in load_eof
                      save(state)
                    File "C:Python26libpickle.py", line 286, in save
                      f(self, obj) # Call unbound method with explicit self
                      r aise EOFError
                   File "C:Python26libpickle.py", line 649, in save_dict
                  EOFError
                      self._batch_setitems(obj.iteritems())
                    File "C:Python26libpickle.py", line 681, in _batch_setitems
                      save(v)
                    File "C:Python26libpickle.py", line 286, in save
                      f(self, obj) # Call unbound method with explicit self
                    File "C:Python26libmultiprocessingforking.py", line 40, in dispatcher
                      self.save_reduce(obj=obj, *rv)
                    File "C:Python26libpickle.py", line 401, in save_reduce
                      save(args)
                    File "C:Python26libpickle.py", line 286, in save
                      f(self, obj) # Call unbound method with explicit self
                    File "C:Python26libpickle.py", line 548, in save_tuple
                      save(element)
                    File "C:Python26libpickle.py", line 331, in save
                      self.save_reduce(obj=obj, *rv)
                    File "C:Python26libpickle.py", line 419, in save_reduce
                      save(state)
                    File "C:Python26libpickle.py", line 286, in save
                      f(self, obj) # Call unbound method with explicit self
                    File "C:Python26libpickle.py", line 649, in save_dict
                      self._batch_setitems(obj.iteritems())
                    File "C:Python26libpickle.py", line 681, in _batch_setitems
                      save(v)
                    File "C:Python26libpickle.py", line 306, in save
                      rv = reduce(self.proto)
                    File "C:Python26libmultiprocessingmanagers.py", line 458, in __reduce__
                      return type(self).from_address, 
                  AttributeError: type object 'SyncManager' has no attribute 'from_address'
                  

                  我正在 Windows 7 上同時測試 Python 2.6 和 2.7,并且一遍又一遍地遇到同樣的錯誤.有人知道是什么意思嗎?

                  I'm testing on both Python 2.6 and 2.7 on Windows 7 and get this same error over and over. Does anybody know what it means?

                  推薦答案

                  Windows有限制,這里是你看到的錯誤的相關部分:

                  There are restrictions on Windows, here is the relevant parts to the errors you are seeing:

                  由于 Windows 缺少 os.fork() 它有一些額外的限制:

                  更易腌制

                  確保 Process.__init__() 的所有參數都是可挑選的.這尤其意味著不能使用綁定或未綁定的方法直接作為 Windows 上的目標參數 - 只需定義一個函數并改用它.

                  Ensure that all arguments to Process.__init__() are picklable. This means, in particular, that bound or unbound methods cannot be used directly as the target argument on Windows — just define a function and use that instead.

                  此外,如果您將 Process 子類化,請確保實例是調用 Process.start() 方法時可挑選.

                  Also, if you subclass Process then make sure that instances will be picklable when the Process.start() method is called.

                  這意味著作為參數傳遞給 Process.__init__() 不能被腌制或解封(Python中的序列化).什么是 SyncManager 它抱怨無法在該對象上找到屬性 AttributeError: type object 'SyncManager' has no attribute 'from_address',這可能是你的根本原因.SyncManager 對象真的可以腌制嗎,是否符合pickle規則?

                  This means that something that is being passed as an argument to Process.__init__() isn't able to be pickled or unpickled ( a serialization in Python ). What is SyncManager it is complaining about not being able to find attributes on that object AttributeError: type object 'SyncManager' has no attribute 'from_address', it is probably your root cause. Can that SyncManager object actually be pickled, does it meet the pickle rules?

                  如果您是從 Windows 上的 命令行運行它,您顯然也不能這樣做.

                  If you are running this from the command line on Windows, you can't do that either apparently.

                  不要那樣做.將代碼保存在文件中,然后使用以下命令從文件中運行它:

                  Don't do that. Save the code in a file and run it from the file instead, with the command:

                  python myfile.py
                  

                  這將解決您的問題.

                  這篇關于Windows 上的多處理中斷的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
                    <tbody id='1HTWQ'></tbody>
                  <legend id='1HTWQ'><style id='1HTWQ'><dir id='1HTWQ'><q id='1HTWQ'></q></dir></style></legend>

                      <tfoot id='1HTWQ'></tfoot>

                      <small id='1HTWQ'></small><noframes id='1HTWQ'>

                      • <i id='1HTWQ'><tr id='1HTWQ'><dt id='1HTWQ'><q id='1HTWQ'><span id='1HTWQ'><b id='1HTWQ'><form id='1HTWQ'><ins id='1HTWQ'></ins><ul id='1HTWQ'></ul><sub id='1HTWQ'></sub></form><legend id='1HTWQ'></legend><bdo id='1HTWQ'><pre id='1HTWQ'><center id='1HTWQ'></center></pre></bdo></b><th id='1HTWQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1HTWQ'><tfoot id='1HTWQ'></tfoot><dl id='1HTWQ'><fieldset id='1HTWQ'></fieldset></dl></div>
                          <bdo id='1HTWQ'></bdo><ul id='1HTWQ'></ul>
                          • 主站蜘蛛池模板: 亚洲精品免费观看 | 狠狠操操 | 久久一区二区三区四区 | 亚洲人成在线观看 | 日韩一区二区三区av | 久久国产精品偷 | 久久久一 | 中文字幕国产视频 | 日韩欧美大片在线观看 | 成人亚洲网| 亚洲精彩免费视频 | 成人一区二区电影 | k8久久久一区二区三区 | 久久精品国产一区二区电影 | 亚洲视频网 | 亚洲精品日韩一区二区电影 | 午夜影院普通用户体验区 | 色婷婷综合久久久中字幕精品久久 | 欧美日韩国产在线 | 亚洲视频在线一区 | 在线播放国产一区二区三区 | 久久伊人免费视频 | 男女下面一进一出网站 | 国产综合久久久 | 91色在线 | 亚洲人成一区二区三区性色 | 一区二区三区久久久 | 午夜精品视频一区 | 一区二区福利视频 | av黄色在线观看 | 天天插天天操 | 亚洲热在线视频 | 亚洲精品日韩在线 | 欧美成人免费在线视频 | 免费观看一级毛片 | 神马久久av | 黄色大片视频 | 欧美日韩福利视频 | 亚洲成人精 | 国产精品国产精品国产专区不卡 | 精品小视频|