AssertionError: In PaddlePaddle 2.x, we turn on dynamic graph mode by default, and 'data()' is only supported in static graph mode. So if you want to use this api, please call 'paddle.enable_static()' before this api to enter static graph mode.
此问题解决之需要在运行前加入:
paddle.enable_static()
本文介绍了解决PaddlePaddle2.x中因默认开启动态图模式而导致无法使用'data()'API的问题。通过调用'paddle.enable_static()'进入静态图模式即可启用该API。
3705

被折叠的 条评论
为什么被折叠?



