成功解决ForkingPickler(file, protocol).dump(obj) TypeError: can‘t pickle Environment objects
成功解決ForkingPickler(file, protocol).dump(obj) TypeError: can't pickle Environment objects
目錄
解決問題
解決思路
解決方法(三種)
T1、將隊列移動到self,而不是作為函數(shù)包和send的參數(shù)
T2、multiprocessing.Manager().Queue()?instead of?multiprocessing.Queue
解決問題
ForkingPickler(file, protocol).dump(obj)
TypeError: can't pickle Environment objects
解決思路
類型錯誤:無法pickle環(huán)境對象
解決方法(三種)
T1、將隊列移動到self,而不是作為函數(shù)包和send的參數(shù)
參考國外網(wǎng)友解釋:TypeError: can't pickle _thread.lock objects
T2、multiprocessing.Manager().Queue()?instead of?multiprocessing.Queue
參考國外網(wǎng)友解釋:multiprocessing.Pool - PicklingError: Can't pickle <type 'thread.lock'>: attribute lookup thread.lock failed
參考文章
python2,socket多進程的錯誤pickle.PicklingError: Can't pickle
python3 PicklingError: Can't pickle attribute lookup on __main
總結(jié)
以上是生活随笔為你收集整理的成功解决ForkingPickler(file, protocol).dump(obj) TypeError: can‘t pickle Environment objects的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 成功解决 keras\callbacks
- 下一篇: DL之CNN:基于CRNN_OCR算法(