环境是TensorFlow2.9
github上要跑的代码TensorFlow环境是1.x

很多api都无法调用

原文代码

train_summary_op = tf.summary.merge([loss_summary])

使用方法1报错

train_summary_op = tf.compat.v1.summary.merge([loss_summary])

显示

TypeError: Tensors in list passed to 'inputs' of 'MergeSummary' Op have types [bool] that do not match expected type string.

解决不了,就试了下将

import tensorflow as tf

修改为

import tensorflow._api.v2.compat.v1 as tf
tf.disable_v2_behavior()

最后成功解决问题

解决 AttributeError: module ‘tensorboard.summary._tf.summary‘ has no attribute ‘merge‘相关推荐

  1. 成功解决AttributeError: module 'tensorflow.python.training.training' has no attribute 'SummaryWriter'

    成功解决AttributeError: module 'tensorflow.python.training.training' has no attribute 'SummaryWriter' 目录 ...

  2. 成功解决AttributeError: module 'tensorflow.python.ops.nn' has no attribute '_seq2seq'

    成功解决AttributeError: module 'tensorflow.python.ops.nn' has no attribute '_seq2seq' 目录 解决问题 解决思路 解决方法 ...

  3. 解决AttributeError: module ‘tensorflow_core._api.v2.config‘ has no attribute ‘experimental_list_device

    环境描述:Anaconda Tensorflow2.1 出现错误: AttributeError: module 'tensorflow_core._api.v2.config' has no att ...

  4. AttributeError: module ‘tensorflow._api.v2.train‘ has no attribute ‘NewCheckpointReader‘解决方案

    解决AttributeError: module 'tensorflow._api.v2.train' has no attribute 'NewCheckpointReader' 问题描述: Ten ...

  5. 成功解决AttributeError: module 'tensorflow' has no attribute 'merge_all_summaries'

    成功解决AttributeError: module 'tensorflow' has no attribute 'merge_all_summaries' 目录 解决问题 解决思路 解决方法 解决问 ...

  6. 成功解决AttributeError: module 'tensorflow' has no attribute 'scalar_summary'

    成功解决AttributeError: module 'tensorflow' has no attribute 'scalar_summary' 目录 解决问题 解决思路 解决方法 解决问题 Att ...

  7. 成功解决AttributeError: module 'tensorflow' has no attribute 'histogram_summary'

    成功解决AttributeError: module 'tensorflow' has no attribute 'histogram_summary' 目录 解决问题 解决思路 解决方法 解决问题 ...

  8. 成功解决 AttributeError: module ‘keras.engine.topology‘ has no attribute ‘load_weights_from_hdf5_group_b

    成功解决 AttributeError: module 'keras.engine.topology' has no attribute 'load_weights_from_hdf5_group_b ...

  9. 成功解决AttributeError: module ‘dask.array.numpy_compat‘ has no attribute ‘take_along_axis‘

    成功解决AttributeError: module 'dask.array.numpy_compat' has no attribute 'take_along_axis' 目录 解决问题 解决思路 ...

最新文章

  1. 苹果正式推iOS 4.2可使iPad支持多任务
  2. 使用Python+Qt时解决QTreeWidget中的内容超出边界后自动隐藏的问题
  3. PHP array_combine()
  4. 为集合排序的三个方法
  5. 区块链应用 | 高烧的区块链,被误读的区块链
  6. w7 mysql不启动_Win7安装mysql5.7服务无法启动没有任何报错信息处理:
  7. Android Activity类详解
  8. python数据1-4
  9. html5音频插件js,jquery音乐播放器插件jsRapAudio
  10. 基于Silverlight4开发的相关工具
  11. Python:猜拳游戏项目(excel形式保存信息)
  12. 一文告诉你16条微信小程序推广渠道大全
  13. 华为鸿蒙harmonyos-面向全场,华为鸿蒙 OS 下月发布?别做梦了……
  14. 【CPU毫秒级】网易易盾点选识别
  15. 干货分享!简单的python爬取网站数据。
  16. MySQL连接查询的成本
  17. 用了接口还有必要用抽象类吗?
  18. java nul 字符_Java字符串替换和NUL(NULL,ASCII 0)字符?
  19. OpenStack 2015.1.0 (Kilo)更新日志
  20. 短信验证码接收网页版常见问题解答

热门文章

  1. iPhone 4G 的工程样机
  2. 南昌python培训机构排名_南昌少儿编程机构十强有哪些
  3. Windows服务器安全策略
  4. C++ goto语句详解
  5. Centos7 bg与fg命令
  6. Soidworks2020提示“使用许可文件不支持此版本”?错误代码是(-21,126,0)
  7. 最近各大论坛铺天盖地“寻马甲包上架的广告”那么问题来了 什么是马甲包,有什么作用
  8. 开发日记——th:field=“*{}“中日期格式化问题
  9. win xp 读写 mac 的时间机器移动硬盘
  10. 520晚上,我用python破解了前女友发来的加密pdf文件,结果却发现...