当前位置:网站首页>[solution] paddlepaddle 2 X call static graph mode
[solution] paddlepaddle 2 X call static graph mode
2022-07-04 21:00:00 【Allenpandas】
Problem analysis
In PaddlePaddle 2.x, we turn on dynamic graph mode by default, and '%s()' 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." % func.__name__
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.
The problem is PaddlePaddle Bag 2.X In the version , The default is to start dynamic graph mode . however data() and %s Can only be supported in static graph mode , If you want to call this api Words , Must be called on api Before adding paddle.enable_static() This line of code .
Solution
# Import paddlepaddle package
import paddle
# Then start the static diagram mode
paddle.enable_static()
边栏推荐
猜你喜欢

二叉树的四种遍历方式以及中序后序、前序中序、前序后序、层序创建二叉树【专为力扣刷题而打造】
Practice examples to understand JS strong cache negotiation cache

idea恢复默认快捷键

【1200. 最小绝对差】

What if the win11 shared file cannot be opened? The solution of win11 shared file cannot be opened

Idea configuration standard notes

Flet tutorial 06 basic introduction to textbutton (tutorial includes source code)

字节测试工程师十年经验直击UI 自动化测试痛点

How to solve the problem that win11 cannot write the value to the registry key?

哈希表、哈希函数、布隆过滤器、一致性哈希
随机推荐
Quelques suggestions pour la conception de l'interface
Vue cleans up the keepalive cache scheme in a timely manner
九齐NY8B062D MCU规格书/datasheet
科普达人丨一文看懂阿里云的秘密武器“神龙架构”
Win11U盘拒绝访问怎么办?Win11U盘拒绝访问的有效解决方法
How does wincc7.5 SP1 find variables and their positions through cross indexing?
ACM组合计数入门
电脑怎么保存网页到桌面上使用
hash 表的概念及应用
托管式服务网络:云原生时代的应用体系架构进化
idea插件
Record the online bug solving list (unfinished to be continued 7/4)
Alibaba testers use UI automated testing to achieve element positioning
LeetCode 8. 字符串转换整数 (atoi)
tcp为啥是三次握手和四次挥手
Idea restore default shortcut key
Après l'insertion de l'image dans le mot, il y a une ligne vide au - dessus de l'image, et la disposition est désordonnée après la suppression
HMS Core 统一扫码服务
电脑共享打印机拒绝访问要怎么办
BFC interview Brief