我正在尝试重新创建Dask仪表板的行为,如此Youtube视频https://www.youtube.com/watch?time_continue=1086&v=N_GqzcuGLCY所示。我可以看到仪表板,但是运行计算时不会更新。
我正在本地计算机(Kubuntu 18.04)上运行所有程序。 我使用anaconda设置了环境,包括
我从命令行设置了计划程序
dask-scheduler
distributed.scheduler - INFO - -----------------------------------------------
distributed.scheduler - INFO - Clear task state
distributed.scheduler - INFO - Scheduler at: tcp://192.168.1.204:8786
distributed.scheduler - INFO - bokeh at: :8787
distributed.scheduler - INFO - Local Directory: /tmp/scheduler-bYQe2p
distributed.scheduler - INFO - -----------------------------------------------
distributed.scheduler - INFO - Register tcp://127.0.0.1:35007
distributed.scheduler - INFO - Starting worker compute stream, tcp://127.0.0.1:35007
...还有一个工人。
dask-worker localhost:8786
distributed.nanny - INFO - Start Nanny at: 'tcp://127.0.0.1:36345'
distributed.worker - INFO - Start worker at: tcp://127.0.0.1:44033
distributed.worker - INFO - Listening to: tcp://127.0.0.1:44033
distributed.worker - INFO - bokeh at: 127.0.0.1:8789
distributed.worker - INFO - nanny at: 127.0.0.1:36345
distributed.worker - INFO - Waiting to connect to: tcp://localhost:8786
distributed.worker - INFO - -------------------------------------------------
distributed.worker - INFO - Threads: 4
distributed.worker - INFO - Memory: 16.70 GB
distributed.worker - INFO - Local Directory: /home/fergal/orbital/repos/projects/safegraph/dask/dask-worker-space/worker-QjJ1ke
distributed.worker - INFO - -------------------------------------------------
distributed.worker - INFO - Registered to: tcp://localhost:8786
distributed.worker - INFO - -------------------------------------------------
然后,我从视频中借来的代码是
from dask.distributed import Client
import dask.array as da
client = Client(processes=False)
print(client)
x = da.random.random((10000, 10000, 10), chunks=(1000,1000,5))
y = da.random.random((10000, 10000, 10), chunks=(1000,1000,5))
z = (da.arcsin(x) + da.arcsin(y)).sum(axis=(1,2))
z.visualize('eg.svg')
z.compute()
代码运行,并通过graph-viz生成图形。可以通过127.0.0.1:8787/status访问bokeh服务器,并根据视频的前几秒钟在右上角显示一个蓝色大块。但是,当我运行代码时,网页不会更新以显示正在运行的计算,计算完成后也不会显示任何结果。我希望能看到类似于我在视频时间1:20看到的东西。
我无疑是忽略了正确设置,但是在文档或Stack Overflow中都找不到任何线索。那我在做什么错了?
答案 0 :(得分:1)
我找到了解决方法。
将dask更新为1.1.5,关闭dask-scheduler(和dask-worker)。我猜我的问题是默认conda频道的dask版本已过时。我从conda-forge下载了新版本