【问题标题】:Is there any other way of conversion to tflite?有没有其他方法可以转换为 tflite?
【发布时间】:2020-09-06 08:43:02
【问题描述】:

我已遵循以下程序:

https://kharbari.com/how-to-convert-pb-to-tflite-format/

但我遇到了这个错误:

“名称‘prefix/MultipleGridAnchorGenerator/assert_equal_1/Assert/Assert:0’指的是一个不存在的张量。操作‘prefix/MultipleGridAnchorGenerator/assert_equal_1/Assert/Assert’存在但只有0个输出。 "

我的代码是:

import tensorflow as tf

def load_graph(frozen_graph_filename):
with tf.compat.v2.io.gfile.GFile(frozen_graph_filename, "rb") as f:
    graph_def = tf.compat.v1.GraphDef()
    graph_def.ParseFromString(f.read())

with tf.Graph().as_default() as graph:
    tf.import_graph_def(graph_def, name="prefix")
return graph


if __name__ == '__main__':
graph = load_graph('/content/123trained.pb')
for op in graph.get_operations():
    abc = graph.get_tensor_by_name(op.name + ":0")
    print(abc)

有人可以帮我调试吗?

如果有其他的程序,请告诉我!!

提前致谢!

【问题讨论】:

    标签: python tensorflow tensorflow-lite


    【解决方案1】:

    TF.Assert 操作没有任何输出张量。 但是,您似乎正试图在 "abc = graph.get_tensor_by_name(op.name + ":0")" 中访问它

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-15
      • 1970-01-01
      • 2020-02-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-04-28
      相关资源
      最近更新 更多