当前位置:网站首页>[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()
边栏推荐
- jekins初始化密码没有或找不到
- 接口設計時的一些建議
- CDGA|数据治理不得不坚持的六个原则
- Summary of the mistakes in the use of qpainter in QT gobang man-machine game
- The concept and application of hash table
- Idea case shortcut
- 栈:如何实现有效括号的判断?
- GVM use
- Common verification rules of form components -1 (continuously updating ~)
- MySQL - database query - use of aggregate function, aggregate query, grouping query
猜你喜欢
uniapp 富文本编辑器使用
Quelques suggestions pour la conception de l'interface
[in-depth learning] review pytoch's 19 loss functions
九齐NY8B062D MCU规格书/datasheet
Idea configuration standard notes
What if win11u disk refuses access? An effective solution to win11u disk access denial
Managed service network: application architecture evolution in the cloud native Era
《动手学深度学习》(三) -- 卷积神经网络 CNN
接口设计时的一些建议
看腾讯大老如何做接口自动化测试
随机推荐
Golang中UTF编码和字符集
【申博攻略】六.如何联系心仪的博导
Leetcode+ 81 - 85 monotone stack topic
What if the computer page cannot be full screen? The solution of win11 page cannot be full screen
Vue cleans up the keepalive cache scheme in a timely manner
看腾讯大老如何做接口自动化测试
See how Tencent does interface automation testing
电脑共享打印机拒绝访问要怎么办
After inserting a picture into word, there is a blank line above the picture, and the layout changes after deletion
软件开发过中的采购
Automatic insertion of captions in word
Win11共享文件打不开怎么办?Win11共享文件打不开的解决方法
Ten years' experience of byte test engineer directly hits the pain point of UI automation test
Why is TCP three handshakes and four waves
idea恢复默认快捷键
Reinforcement learning - learning notes 2 | value learning
WinCC7.5 SP1如何通过交叉索引来寻找变量及其位置?
哈希表、哈希函数、布隆过滤器、一致性哈希
Sword finger offer II 80-100 (continuous update)
工厂从自动化到数字孪生,图扑能干什么?