程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了带有张量流的 Dask 因“CRITICAL - Failed to Serialize”错误而失败大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决带有张量流的 Dask 因“CRITICAL - Failed to serialize”错误而失败?

开发过程中遇到带有张量流的 Dask 因“CRITICAL - Failed to serialize”错误而失败的问题如何解决?下面主要结合日常开发的经验,给出你关于带有张量流的 Dask 因“CRITICAL - Failed to serialize”错误而失败的解决方法建议,希望对你解决带有张量流的 Dask 因“CRITICAL - Failed to serialize”错误而失败有所启发或帮助;

我已经安装了 dask[complete]、tensorflow、scikeras、deplayed、dask-ml。 我在本地运行相同的示例 link。工作日志中也没有堆栈跟踪。请帮助我提供进一步调试的输入。

代码失败,错误如下:

diStributed.protocol.core - CRITICAL - Failed to serialize
TraceBACk (most recent call last):
  file "/library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diStributed/protocol/core.py",line 70,in dumps
    frames[0] = msgpack.dumps(msg,default=_encode_default,use_bin_type=TruE)
  file "/library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/msgpack/__init__.py",line 35,in packb
    return Packer(**kwargs).pack(o)
  file "msgpack/_packer.pyx",line 292,in msgpack._CMSgpack.Packer.pack
  file "msgpack/_packer.pyx",line 298,line 295,line 264,in msgpack._CMSgpack.Packer._pack
  file "msgpack/_packer.pyx",line 231,line 229,line 289,in msgpack._CMSgpack.Packer._pack
TypeError: can not serialize 'Delayed' object
diStributed.comm.utils - ERROR - can not serialize 'Delayed' object
TraceBACk (most recent call last):
  file "/library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diStributed/comm/utils.py",line 32,in _to_frames
    msg,serializers=serializers,on_error=on_error,context=context
  file "/library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diStributed/protocol/core.py",in msgpack._CMSgpack.Packer._pack
TypeError: can not serialize 'Delayed' object
diStributed.batched - ERROR - Error in batched write
TraceBACk (most recent call last):
  file "/library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diStributed/batched.py",line 94,in _BACkground_send
    payload,serializers=self.serializers,on_error="raise"
  file "/library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/tornado/gen.py",line 762,in run
    value = future.result()
  file "/library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diStributed/comm/tcp.py",@R_918_5450@3,in write
    **self.handshake_options,file "/library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diStributed/comm/utils.py",line 51,in to_frames
    return _to_frames()
  file "/library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/diStributed/comm/utils.py",in msgpack._CMSgpack.Packer._pack
TypeError: can not serialize 'Delayed' object
---------------------------------------------------------------------------

解决方法

这似乎是 dask-ml 中的一个错误:https://github.com/dask/dask/issues/7571

更新到最新版本(目前未发布,您必须从 GitHub 安装)似乎可以解决问题:

$ pip install git+https://github.com/dask/dask-ml.git

大佬总结

以上是大佬教程为你收集整理的带有张量流的 Dask 因“CRITICAL - Failed to Serialize”错误而失败全部内容,希望文章能够帮你解决带有张量流的 Dask 因“CRITICAL - Failed to Serialize”错误而失败所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:-to