当前位置:网站首页>【解决方案】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()
边栏推荐
- What if win11u disk refuses access? An effective solution to win11u disk access denial
- In the face of the same complex test task, why can the elder sort out the solution quickly? Ali's ten-year test engineers showed their skills
- AP8022开关电源小家电ACDC芯片离线式开关电源IC
- Automatic generation of interface automatic test cases by actual operation
- NetCore3.1 Json web token 中间件
- Flet tutorial 04 basic introduction to filledtonalbutton (tutorial includes source code)
- 电脑怎么保存网页到桌面上使用
- Flet教程之 06 TextButton基础入门(教程含源码)
- 托管式服务网络:云原生时代的应用体系架构进化
- Flet教程之 08 AppBar工具栏基础入门(教程含源码)
猜你喜欢
剑指 Offer II 80-100(持续更新)
NetCore3.1 Json web token 中间件
So this is the BGP agreement
Flet教程之 04 FilledTonalButton基础入门(教程含源码)
[ismb2022 tutorial] the picture shows the precision medicine of learning. Marinka zitnik, Harvard University, keynote speaker, with 87 ppt
黄金k线图中的三角形有几种?
Summary of the mistakes in the use of qpainter in QT gobang man-machine game
hash 表的概念及应用
Reinforcement learning - learning notes 2 | value learning
Win11系统wifi总掉线怎么办?Win11系统wifi总掉线的解决方法
随机推荐
What should I do if my computer sharing printer refuses access
易周金融 | Q1保险行业活跃人数8688.67万人 19家支付机构牌照被注销
企业数字化转型最佳实践案例:基于云的数字化平台系统安全措施简介与参考
FS4061A升压8.4V充电IC芯片和FS4061B升压12.6V充电IC芯片规格书datasheet
Automatic insertion of captions in word
Taishan Office Technology Lecture: about the order of background (shading and highlighting)
Play the music of youth
LeetCode+ 81 - 85 单调栈专题
Redis分布式锁的实现
太方便了,钉钉上就可完成代码发布审批啦!
Aiming at the "amnesia" of deep learning, scientists proposed that based on similarity weighted interleaved learning, they can board PNAS
Jekins initialization password not found or not found
Selected review | machine learning technology for Cataract Classification / classification
Reinforcement learning - learning notes 2 | value learning
How does the computer save web pages to the desktop for use
word中插入图片后,图片上方有一空行,且删除后布局变乱
Lingyun going to sea | Wenhua online & Huawei cloud: creating a new solution for smart teaching in Africa
九齐NY8B062D MCU规格书/datasheet
So this is the BGP agreement
Flet教程之 04 FilledTonalButton基础入门(教程含源码)