【问题标题】:Tensorflow 2.0 : AttributeError: module 'tensorflow' has no attribute 'matrix_band_part'Tensorflow 2.0:AttributeError:模块“tensorflow”没有属性“matrix_band_part”
【发布时间】:2020-05-14 16:04:42
【问题描述】:

在运行代码 tf.matrix_band_part 时,我收到以下错误

AttributeError: module 'tensorflow' has no attribute 'matrix_band_part'

我的张量流版本:2.0

这个问题需要任何解决方案。

【问题讨论】:

    标签: tensorflow2.0 attributeerror


    【解决方案1】:

    我找到了答案。所以我想分享一下。

    tensorflow 2.0 的兼容版本是

    tf.compat.v1.matrix_band_part
    

    参考:https://www.tensorflow.org/api_docs/python/tf/linalg/band_part

    【讨论】:

      猜你喜欢
      • 2019-08-04
      • 2020-08-17
      • 2019-10-05
      • 2020-12-06
      • 2017-04-08
      • 2020-02-04
      • 2020-02-12
      • 2019-01-10
      • 2019-10-01
      相关资源
      最近更新 更多