【问题标题】:Tensorflow - Converting a pruned model to a lower quantization with tfliteTensorflow - 使用 tflite 将修剪后的模型转换为较低的量化
【发布时间】:2020-03-08 02:05:22
【问题描述】:

我正在尝试使用 TFLite 量化修剪后的张量流模型。修剪和量化都独立工作,但是当我尝试修剪然后量化时,我得到这个错误:ValueError: Input 0 of node sequential/prune_low_magnitude_dense/AssignVariableOp was passed float from sequential/prune_low_magnitude_dense/Mul/ReadVariableOp/resource:0 incompatible with expected resource. 当我尝试量化然后修剪时,我得到这个错误:ValueError: 'prune_low_magnitude' can only prune an object of the following types: tf.keras.models.Sequential, tf.keras functional model, tf.keras.layers.Layer, list of tf.keras.layers.Layer. You passed an object of type: bytes.

我应该怎么做才能使这些操作兼容?该模型的类型为 tf.keras.models.Sequential,出于测试目的,只有一层深。

【问题讨论】:

  • Python 3.6,Tensorflow 2.1,稀疏函数来自 tensorflow_model_optimization 版本 0.2.1。如果这很重要,Windows 10。
  • 我也遇到了这个问题。现在寻找答案。
  • 自 1 年以来没有答案?

标签: python tensorflow keras quantization tensorflow-lite


【解决方案1】:
猜你喜欢
  • 1970-01-01
  • 2018-09-07
  • 2020-09-10
  • 1970-01-01
  • 1970-01-01
  • 2019-05-06
  • 2020-12-03
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多