Dask Distributed produces AttributeError: 'HighLevelGraph' object has no attribute '__dask_distributed_pack__'
Dask Distributed produces AttributeError: 'HighLevelGraph' object has no attribute '__dask_distributed_pack__'
我在 3 台 AWS T2 机器上有一个小型开发集群。一台机器作为客户端,一台作为调度器,最后一台作为工作者。我对所有这些都执行了 git clone
并在所有 3 个上手动安装了 Numpy 版本 1.21.0
。但是,在遵循基本设置时,执行 A = client.map(square , range(10)) 在 Python3(3.8) 解释器上。如何解决这个问题?似乎是一个内部错误,Dask 是在客户端机器上通过 pip 安装获得的。
ubuntu@ip-172...:~$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dask.distributed import Client
>>> client = Client('IPv4Addr:8786')
>>> client
<Client: 'tcp://172...:8786' processes=1 threads=4, memory=8.18 GB>
>>> def square(x):
... return x ** 2
...
>>> A = client.map(square, range(10))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/distributed-2021.2.0+19.g2c5d2cf8-py3.8.egg/distributed/client.py", line 1764, in map
futures = self._graph_to_futures(
File "/usr/local/lib/python3.8/dist-packages/distributed-2021.2.0+19.g2c5d2cf8-py3.8.egg/distributed/client.py", line 2542, in _graph_to_futures
dsk = dsk.__dask_distributed_pack__(self, keyset)
AttributeError: 'HighLevelGraph' object has no attribute '__dask_distributed_pack__'
对于遇到相同问题的任何人,一个可能的解决方法(对我们有用的方法)是创建一个虚拟环境,您将在其中安装 Dask 及其所有依赖项。
1- 在新创建的 venv 上安装 Dask
2- 使用 $ pip freeze > ~/requirements.txt
生成需求规范
3- 在 worker 和客户端机器上创建一个 venv 并在所述环境上执行 $ pip install -r requirements.txt
这将保证相同的环境,并有望防止各种问题,例如原始问题中详述的问题。
我们收到了相同的错误消息。事实证明,我们在 dask 和 distributed 包之间存在版本不匹配。分布式升级到 2021.3.0,而 dask 仍然是 2020.12.0。降级分发到旧版本解决了这个问题。
我在 3 台 AWS T2 机器上有一个小型开发集群。一台机器作为客户端,一台作为调度器,最后一台作为工作者。我对所有这些都执行了 git clone
并在所有 3 个上手动安装了 Numpy 版本 1.21.0
。但是,在遵循基本设置时,执行 A = client.map(square , range(10)) 在 Python3(3.8) 解释器上。如何解决这个问题?似乎是一个内部错误,Dask 是在客户端机器上通过 pip 安装获得的。
ubuntu@ip-172...:~$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from dask.distributed import Client
>>> client = Client('IPv4Addr:8786')
>>> client
<Client: 'tcp://172...:8786' processes=1 threads=4, memory=8.18 GB>
>>> def square(x):
... return x ** 2
...
>>> A = client.map(square, range(10))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/distributed-2021.2.0+19.g2c5d2cf8-py3.8.egg/distributed/client.py", line 1764, in map
futures = self._graph_to_futures(
File "/usr/local/lib/python3.8/dist-packages/distributed-2021.2.0+19.g2c5d2cf8-py3.8.egg/distributed/client.py", line 2542, in _graph_to_futures
dsk = dsk.__dask_distributed_pack__(self, keyset)
AttributeError: 'HighLevelGraph' object has no attribute '__dask_distributed_pack__'
对于遇到相同问题的任何人,一个可能的解决方法(对我们有用的方法)是创建一个虚拟环境,您将在其中安装 Dask 及其所有依赖项。
1- 在新创建的 venv 上安装 Dask
2- 使用 $ pip freeze > ~/requirements.txt
3- 在 worker 和客户端机器上创建一个 venv 并在所述环境上执行 $ pip install -r requirements.txt
这将保证相同的环境,并有望防止各种问题,例如原始问题中详述的问题。
我们收到了相同的错误消息。事实证明,我们在 dask 和 distributed 包之间存在版本不匹配。分布式升级到 2021.3.0,而 dask 仍然是 2020.12.0。降级分发到旧版本解决了这个问题。