paddle里找不到enable_static,有什么办法吗
所有版本都试过了
报错显示:AttributeError: module 'paddle' has no attribute 'enable_static'
使用的Paddle没有对应的函数接口, 建议升级到的develop版。
1:卸载原来版本 python -m pip uninstall paddlepaddle-gpu
2:安装新版本
python -m pip install paddlepaddle-gpu==0.0.0.post102 -f https://www.paddlepaddle.org.cn/whl/linux/gpu/develop.html
望采纳
先看看你的paddle版本是不是太高了。
pip list | grep paddle
看看你的paddlepaddlle版本是多少。
发下代码, 看下代码是否有变量名称和paddle一样, 导致冲突
paddle在导入时报错
https://jingyan.baidu.com/article/ed15cb1b418b755ae2698116.html
AttributeError: module 'paddle' has no attribute 'enable_static'
AttributeError:模块“paddle”没有属性“enable_static”
思路:
更新Paddle版本到2.0+
因为现在默认动态图, 跑静态图需要添加paddle.enable_static()
看报错是静态链接库没连上,初步估计是相关的依赖配置没安装,不知道错误提示有没有其他提示不好说,可以试试用paddlepaddle安装这个默认配置多一些;
问题:module ‘paddle’ has no attribute ‘enable_static’
解决方案:
现在默认动态图 跑静态图需要添加paddle.enable_static() 请更新Paddle版本到2.0+
可以考虑更新一下paddle模块的版本。