当前位置:网站首页>[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()
边栏推荐
- ACM组合计数入门
- Flet教程之 06 TextButton基础入门(教程含源码)
- mysql语句执行详解
- [1200. Différence absolue minimale]
- Practice examples to understand JS strong cache negotiation cache
- [server data recovery] a case of RAID5 data recovery stored in a brand of server
- Function analysis and source code of hash guessing game system development
- 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
- PermissionError: [Errno 13] Permission denied: ‘data.csv‘
- Win11系统wifi总掉线怎么办?Win11系统wifi总掉线的解决方法
猜你喜欢
MySQL - database query - use of aggregate function, aggregate query, grouping query
Form组件常用校验规则-1(持续更新中~)
Summary of the mistakes in the use of qpainter in QT gobang man-machine game
WinCC7.5 SP1如何通过交叉索引来寻找变量及其位置?
Idea configuration standard notes
剑指 Offer II 80-100(持续更新)
电脑页面不能全屏怎么办?Win11页面不能全屏的解决方法
What if the brightness of win11 is locked? Solution to win11 brightness locking
[observation] Lenovo: 3x (1+n) smart office solution, releasing the "multiplier effect" of office productivity
福昕PDF编辑器v10.1.8绿色版
随机推荐
acwing 3302. 表达式求值
CDGA|数据治理不得不坚持的六个原则
Win11亮度被锁定怎么办?Win11亮度被锁定的解决方法
Flet教程之 08 AppBar工具栏基础入门(教程含源码)
idea大小写快捷键
Idea configuration standard notes
Go notes (3) usage of go language FMT package
Alibaba testers use UI automated testing to achieve element positioning
《动手学深度学习》(三) -- 卷积神经网络 CNN
Go notes (1) go language introduction and characteristics
RFID仓储管理系统解决方案的优点
uniapp 富文本编辑器使用
vim异步问题
Flet教程之 05 OutlinedButton基础入门(教程含源码)
Hash哈希竞猜游戏系统开发如何开发丨哈希竞猜游戏系统开发(多套案例)
WinCC7.5 SP1如何通过交叉索引来寻找变量及其位置?
阿里测试师用UI自动化测试实现元素定位
idea恢复默认快捷键
RFID仓库管理系统解决方案有哪些功能模块
栈:如何实现有效括号的判断?