当前位置:网站首页>【解决方案】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()
边栏推荐
- 哈希(Hash)竞猜游戏系统开发功能分析及源码
- Win11共享文件打不开怎么办?Win11共享文件打不开的解决方法
- NetCore3.1 Json web token 中间件
- 看腾讯大老如何做接口自动化测试
- Flet tutorial 04 basic introduction to filledtonalbutton (tutorial includes source code)
- 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
- MySQL中的日期时间类型与格式化方式
- 左右最值最大差问题
- What should I do if my computer sharing printer refuses access
- 被奉为经典的「金字塔原理」,教给我们哪些PPT写作技巧?
猜你喜欢
MySQL --- 数据库查询 - 聚合函数的使用、聚合查询、分组查询
What if the win11 shared file cannot be opened? The solution of win11 shared file cannot be opened
idea恢复默认快捷键
阿里测试师用UI自动化测试实现元素定位
QT writing the Internet of things management platform 38- multiple database support
ICML 2022 | meta proposes a robust multi-objective Bayesian optimization method to effectively deal with input noise
[ismb2022 tutorial] the picture shows the precision medicine of learning. Marinka zitnik, Harvard University, keynote speaker, with 87 ppt
See how Tencent does interface automation testing
idea配置标准注释
针对深度学习的“失忆症”,科学家提出基于相似性加权交错学习,登上PNAS
随机推荐
NetCore3.1 Json web token 中间件
Lingyun going to sea | Murong Technology & Huawei cloud: creating a model of financial SaaS solutions in Africa
字节测试工程师十年经验直击UI 自动化测试痛点
黄金k线图中的三角形有几种?
MySQL --- 数据库查询 - 聚合函数的使用、聚合查询、分组查询
Function analysis and source code of hash guessing game system development
Flet教程之 08 AppBar工具栏基础入门(教程含源码)
Ten years' experience of byte test engineer directly hits the pain point of UI automation test
企业数字化转型最佳实践案例:基于云的数字化平台系统安全措施简介与参考
Hands on deep learning (III) -- convolutional neural network CNN
Win11亮度被锁定怎么办?Win11亮度被锁定的解决方法
CDGA|数据治理不得不坚持的六个原则
Why is the maximum speed the speed of light
Automatic generation of interface automatic test cases by actual operation
什么叫内卷?
Redis分布式锁的实现
GVM使用
哈希(Hash)竞猜游戏系统开发功能分析及源码
Flet tutorial 05 outlinedbutton basic introduction (tutorial includes source code)
Understand Alibaba cloud's secret weapon "dragon architecture" in the article "science popularization talent"