``当在paddlepaddle2.的版本中按照paddlepaddle版本的写法,有以下报错的时候。
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()
即可解决报错问题。