PaddlePaddle/PGL

在paddlepaddle 2.4.0上跑readme的例子就会出错

jiamingkong opened this issue · 3 comments

我的环境是paddlepaddle 2.4.0,cuda 11.2 cuDNN 8.2。

直接运行readme.md 中的例子(聚合函数),会报错:

>>> ret = g.recv(recv_func, msg)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\kinet\anaconda3\envs\paddle\lib\site-packages\pgl\graph.py", line 236, in recv
    src, dst, eid = self.sorted_edges(sort_by=recv_mode)
  File "C:\Users\kinet\anaconda3\envs\paddle\lib\site-packages\pgl\graph.py", line 605, in sorted_edges
    dst, src, eid = self.adj_dst_index.triples()
  File "C:\Users\kinet\anaconda3\envs\paddle\lib\site-packages\pgl\graph.py", line 548, in adj_dst_index
    self._adj_dst_index = EdgeIndex.from_edges(
  File "C:\Users\kinet\anaconda3\envs\paddle\lib\site-packages\pgl\utils\edge_index.py", line 42, in from_edges
    self._degree = scatter(
  File "C:\Users\kinet\anaconda3\envs\paddle\lib\site-packages\pgl\utils\helper.py", line 109, in scatter
    return _C_ops.scatter(x, index, updates, 'overwrite', overwrite)
ValueError: (InvalidArgument) scatter(): argument (position 4) must be bool, but got str (at ..\paddle\fluid\pybind\op_function_common.cc:124)

我发现了直接去改一下pgl的源代码就可以跑通,看来是paddle 新版的API和pgl 之间的兼容问题:

修改pgl/utils/helper.py 第108行:

    if non_static_mode():
        # return _C_ops.scatter(x, index, updates, 'overwrite', overwrite)
        # 改成下面这样:
        return _C_ops.scatter(x, index, updates, overwrite)

你的版本可能比较久了,新的版本目前helper的scatter已经直接调用Paddle的了,没有这个问题了。

你的版本可能比较久了,新的版本目前helper的scatter已经直接调用Paddle的了,没有这个问题了。

I install the paddlepaddle-gpu-2.4.1.post112 version, the same problem happens