Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 通过光线问题并行_Python_Ray - Fatal编程技术网

Python 通过光线问题并行

Python 通过光线问题并行,python,ray,Python,Ray,试图并行化此代码,但出现错误:TypeError:无法直接调用远程函数。不要运行“\uuuu main\uuuu.parallel1()”,而是尝试“\uuuu main\uuuu.parallel1.remote()” ray lib是通过pip安装的 x_id=parallel1.remote(-1) y_id=parallel2.remote(-1) 嗯,您是否尝试过像错误消息所建议的那样运行它们,如\uuu main\uuu.parallel1.remote()?您知道如何获取ray中的

试图并行化此代码,但出现错误:
TypeError:无法直接调用远程函数。不要运行“\uuuu main\uuuu.parallel1()”,而是尝试“\uuuu main\uuuu.parallel1.remote()”

ray lib是通过pip安装的

x_id=parallel1.remote(-1)
y_id=parallel2.remote(-1)

嗯,您是否尝试过像错误消息所建议的那样运行它们,如
\uuu main\uuu.parallel1.remote()
?您知道如何获取ray中的GPU数吗?它与amd图形卡一起工作吗?
    @ray.remote
    def parallel1(a):
        Gbr1 = ExponentialSmoothing(endog=series1['Price'],trend = True,damped_trend = True).fit(disp = False)
        pr1 = list(Gbr1.forecast(136).values)[-1]
        return pr1
    @ray.remote
    def parallel2(a):
        Gbr2 = ExponentialSmoothing(endog=series2['Price'],trend = True,damped_trend = True).fit(disp = False)
        pr2 = list(Gbr2.forecast(90).values)[-1]
        return pr2
    x_id = parallel1(-1).remote()
    y_id = parallel2(-1).remote()
    pr1,pr2 = ray.get([x_id,y_id])