-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
input type Graph 时的静态图转换 #475
Comments
https://github.com/PaddlePaddle/PGL/blob/main/examples/deploy_gnn/convert_to_static.py 建议你可以用这种方法来,动静转换,不建议直接用 graph作为forward对象。最好把边和特征显式列出来再转 |
好的。麻烦问下,就是说目前@paddle.jit.to_static用graph input还不支持是吧。如果已经支持,seg fault只是个例,我会先尝试其他model。谢谢。 |
因为paddle里面的jit只支持tensor输入,不支持复杂自定义数据结构。所以如果你要直接用jit.to_static应该还是要改一下的,我估计应该像下面这种改法,仿照我上面说的,估计是可以的。
|
好的,非常感谢。 |
Hi,我试了下发现会有如下问题: AssertionError: 'numpy' only can be called by
如果是numpy在static graph下用不了,那岂不是目前所有PGL model都用不了静态图了?因为https://github.com/PaddlePaddle/PGL/blob/main/pgl/graph.py 使用了numpy。谢谢。 |
如果你要搞静态图,你可以看看这里的写法 https://github.com/PaddlePaddle/PGL/blob/main/examples/deploy_gnn/convert_to_static.py
先定义一些placehodler,然后输入到网络里,在用静态图组网
然后数据加载的地方全部用numpy的图 |
1、比如在PGL/examples/gin/model.py中加入
@paddle.jit.to_static
def forward(self, graph):
会报seg fault
2、在paddle.jit.save的api文档中也未发现input type为Graph时的input_spec说明。
麻烦请问如何将PGL的model存为静态图model,谢谢。如果已经支持此功能,我可以提供详细fault信息。谢谢。
The text was updated successfully, but these errors were encountered: