当前位置:网站首页>[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()
边栏推荐
- LeetCode+ 81 - 85 单调栈专题
- Cdga | six principles that data governance has to adhere to
- 【申博攻略】六.如何联系心仪的博导
- 【1200. 最小絕對差】
- Automatic generation of interface automatic test cases by actual operation
- Hash quiz game system development how to develop hash quiz game system development (multiple cases)
- LeetCode 7. Integer inversion
- go笔记(1)go语言介绍以及特点
- 左右最值最大差问题
- See how Tencent does interface automation testing
猜你喜欢
随机推荐
什么是区块哈希竞猜游戏系统开发?哈希竞猜游戏系统开发(案例成熟)
Play the music of youth
【解决方案】PaddlePaddle 2.x调用静态图模式
Stack: how to realize the judgment of valid brackets?
How to solve the problem that win11 cannot write the value to the registry key?
电脑页面不能全屏怎么办?Win11页面不能全屏的解决方法
分析伦敦银走势图的技巧
Form组件常用校验规则-1(持续更新中~)
Jekins initialization password not found or not found
VIM asynchronous problem
word中插入图片后,图片上方有一空行,且删除后布局变乱
[server data recovery] a case of RAID5 data recovery stored in a brand of server
E-week finance | Q1 the number of active people in the insurance industry was 86.8867 million, and the licenses of 19 Payment institutions were cancelled
Flet教程之 05 OutlinedButton基础入门(教程含源码)
Go language notes (4) go common management commands
RFID仓库管理系统解决方案有哪些功能模块
Advantages of semantic tags and block level inline elements
软件开发过中的采购
Hands on deep learning (III) -- convolutional neural network CNN
记一次重复造轮子(Obsidian 插件设置说明汉化)