一般出现此类问题的原因是包的更新导致有些用法发生了变化,因此在tensorflow中调用optimizer需要通过tf.keras调用。

self.opt = tf.optimizers.Adam(learning_rate=self.lr)中的tf后面加个keras,
变成self.opt = tf.keras.optimizers.Adam(learning_rate=self.lr)

解决module ‘tensorflow‘ has no attribute ‘optimizers‘报错相关推荐

  1. tf2.0不降版本也能完美解决module ‘tensorflow’ has no attribute ‘contrib’的问题

    tf2.0不降版本也能完美解决module 'tensorflow' has no attribute 'contrib'的问题 看图 tf2.0版本更改 我在学习的过程中,发现了大佬们写的项目都是在 ...

  2. AttributeError: module ‘tushare‘ has no attribute ‘get_k_data‘报错解决方法

    出现标题所示错误时,出错原因是你的python文件命名成了tushare.py,python解释器解析代码的时候从你的文件里找函数未找到而报错.

  3. Python-AttributeError: module ‘pandas‘ has no attribute ‘ewma‘报错解决方法

    将 ewma60=pd.ewma(aapl_px,span=60) 改为 ewma60 = pd.DataFrame.ewm(aapl_px,span=60).mean() ATR = pd.Seri ...

  4. 【解决问题】AttributeError: module ‘pandas‘ has no attribute ‘ewma‘报错解决方法

    将 ewma60=pd.ewma(aapl_px,span=60) 改为 ewma60 = pd.DataFrame.ewm(aapl_px,span=60).mean()

  5. 解决问题】AttributeError: module 'pandas' has no attribute 'ewma'报错解决方法

    将 ewma60=pd.ewma(aapl_px,span=60) 改为 ewma60 = pd.DataFrame.ewm(aapl_px,span=60).mean()

  6. 关于module ‘datetime‘ has no attribute ‘now‘报错解决方案

    原代码: import datetime print(datetime.now()) 思路一(datetime.datetime): import datetimeprint(datetime.dat ...

  7. 【TensorFlow报错】AttributeError: module 'tensorflow' has no attribute 'merge_all_summaries'

    报错提示: cifar10_train.py : AttributeError: module 'tensorflow' has no attribute 'merge_all_summaries' ...

  8. 解决module ‘numpy‘ has no attribute ‘array‘问题

    然后执行出现了 File "pandas/_libs/src\numpy.pxd", line 157, in init pandas._libs.tslib AttributeE ...

  9. AttributeError: module ‘tensorflow‘ has no attribute ‘InteractiveSession‘或 ‘placeholder‘的解决

    问题提示: AttributeError: module 'tensorflow' has no attribute 'InteractiveSession' 或者: AttributeError: ...

最新文章

  1. android values-v21 style 报错,Android 4.4 以上实现透明导航栏和状态栏 Translucent system bar...
  2. android 线程锁Lock
  3. 博客园使用highlight.js对代码进行高亮,并实现自定义关键词高亮
  4. hdu-5781 ATM Mechine(dp+概率期望)
  5. .NET Core中的CSV解析库
  6. 【转】在无人值守程序(服务)中调用Microsoft Graph
  7. 基于socket编程的多人聊天室
  8. c语言链表的数据结构,c语言实现通用数据结构(一):通用链表
  9. 深入浅出通信原理知识点4
  10. 微信小程序-云支付那些事儿
  11. MagicDraw-状态机图
  12. windows server 2008 r2集成USB3.0
  13. camera 添加外挂pmic进行供电的涉及
  14. ReentrantReadWriteLock、StampedLock
  15. HDU-6578 Blank
  16. Qt 5入门指南之Qt Quick编程示例
  17. heic格式的图片h5显示
  18. mysql排名第一_SQL查询排名第二名的信息
  19. 【经验】漫画中人物手臂怎么画?
  20. 安卓手机合并内存卡到内置存储

热门文章

  1. sqlserver建表语句_重新认识MySQL中的COUNT语句
  2. 一元二次方程求根公式的花样变换,你看懂了吗?
  3. 和男朋友出去玩,该去哪里​?
  4. Cell发文!施一公科研团队取得重大突破
  5. 史上最严重的忘拿钥匙事件 | 今日最佳
  6. 催人泪下!一个程序员的悲惨故事
  7. Linux系统管理员的Bash指南,11条Bash实践经验!
  8. 30 个实例详解 TOP 命令
  9. python入门html_python-html入门
  10. bytecode java_Java 字节码解读