报错:
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 ’
’ before this api to enter static graph mode.
解决方法:
在报错前添加
paddle.enable_static()