当前位置:网站首页>【解决方案】PaddlePaddle 2.x调用静态图模式
【解决方案】PaddlePaddle 2.x调用静态图模式
2022-07-04 19:28:00 【Allenpandas】
问题分析
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.
问题说在PaddlePaddle包的2.X版本中,默认是启动动态图模式的。但是data()和%s只能在静态图模式下被支持,如果想调用这个api的话,必须在调用api之前添加paddle.enable_static()这一行代码。
解决方案
# 导入paddlepaddle包
import paddle
# 紧跟着开启静态图模式
paddle.enable_static()
边栏推荐
- 一文搞懂Go语言中文件的读写与创建
- Flet tutorial 04 basic introduction to filledtonalbutton (tutorial includes source code)
- 记一次重复造轮子(Obsidian 插件设置说明汉化)
- 九齐单片机NY8B062D单按键控制4种LED状态
- 工厂从自动化到数字孪生,图扑能干什么?
- NLP, vision, chip What is the development direction of AI? Release of the outlook report of Qingyuan Association [download attached]
- ICML 2022 | meta proposes a robust multi-objective Bayesian optimization method to effectively deal with input noise
- What if the WiFi of win11 system always drops? Solution of WiFi total drop in win11 system
- Qt五子棋人机对战画棋子之QPainter的使用误区总结
- [ismb2022 tutorial] the picture shows the precision medicine of learning. Marinka zitnik, Harvard University, keynote speaker, with 87 ppt
猜你喜欢
Practical examples of node strong cache and negotiation cache

电脑共享打印机拒绝访问要怎么办

Hands on deep learning (III) -- convolutional neural network CNN

Win11U盘拒绝访问怎么办?Win11U盘拒绝访问的有效解决方法

QT writing the Internet of things management platform 38- multiple database support

Idea restore default shortcut key

What should I do if my computer sharing printer refuses access

Fleet tutorial 08 introduction to AppBar toolbar Basics (tutorial includes source code)

Qt五子棋人机对战画棋子之QPainter的使用误区总结

MySQL --- 数据库查询 - 聚合函数的使用、聚合查询、分组查询
随机推荐
LeetCode+ 81 - 85 单调栈专题
What ppt writing skills does the classic "pyramid principle" teach us?
记录线上bug解决list(未完待续7/4)
Implementation of redis distributed lock
伦敦银走势图分析的新方法
PermissionError: [Errno 13] Permission denied: ‘data.csv‘
Talking about cookies of client storage technology
浏览器渲染页面过程
[in-depth learning] review pytoch's 19 loss functions
MySQL --- 数据库查询 - 聚合函数的使用、聚合查询、分组查询
What is involution?
Hash quiz game system development how to develop hash quiz game system development (multiple cases)
什么叫内卷?
[today in history] July 4: the first e-book came out; The inventor of magnetic stripe card was born; Palm computer pioneer was born
接口设计时的一些建议
How does win11 search for wireless displays? Win11 method of finding wireless display device
[Beijing Xunwei] i.mx6ull development board porting Debian file system
剑指 Offer II 80-100(持续更新)
WinCC7.5 SP1如何通过交叉索引来寻找变量及其位置?
Understand Alibaba cloud's secret weapon "dragon architecture" in the article "science popularization talent"