PaddlePaddle: AssertionError: In PaddlePaddle 2.x, we turn on dynamic graph mode by default

报错:

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()

猜你喜欢

转载自blog.csdn.net/qq_52118067/article/details/122047097
今日推荐