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.
解决方法:
import paddle
# 在所有的import后面加下面的这句话
paddle.enable_static()