【问题标题】:Dtype to nparray.dtypedtype 到 np array.dtype
【发布时间】:2018-12-16 18:11:35
【问题描述】:

我的意图是在tensorflow中对一个张量使用pywavelet,用句子

pywt.dwt(input,'db1')

错误是

Cannot convert DType to numpy.dtype

输入是来自 MNIST 数据集的 Tensor("Reshape_18:0", shape=(?, 28, 28, 1), dtype=float32)

我尝试使用句子 pywt.dwt(input.dtype.as_numpy_dtype,'db1') 和错误“invalid array_struct”。

【问题讨论】:

    标签: python tensorflow pywavelets


    【解决方案1】:

    pywt.dwt() 采用一维数组。

    但看起来你有一个 4D 数组,所以你想使用 pywt.dwtn() Docs here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-09
      • 2017-08-01
      • 2012-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-24
      相关资源
      最近更新 更多