首页 > 解决方案 > Ray 库抛出“setpgrp failed”错误

问题描述

我是 Ray 库的新手,当我执行它时,我发现了一些错误

import ray
# Start Ray. If you're connecting to an existing cluster, you would use
# ray.init(address=<cluster-address>) instead.
ray.init()

错误:

2019-12-30 09:39:42,656 警告 services.py:597 -- setpgrp 失败,进程可能无法正确清理:[Errno 1] 不允许操作。

我认为由于这个错误,所以当我运行我的代码时,我的内核会死掉。

# Execute Python functions in parallel.
import ray
ray.init()

@ray.remote
def f(x):
    return x * x

futures = [f.remote(i) for i in range(4)]
print(ray.get(futures))

标签: python-3.7ray

解决方案


推荐阅读