我很难列出TFLite模型的操作。我知道可以给出一个冻结图来列出操作,但是TFLite .tflite模型呢?可以列出操作吗?
发布于 2019-05-27 16:07:25
正如在TensorFlow Lite文档中提到的,您需要使用tf.lite.Interpreter来解析.tflite模型。
# Load TFLite model and allocate tensors.
interpreter = tf.lite.Interpreter(model_path="converted_model.tflite")
interpreter.allocate_tensors()然后使用get_tensor_details方法获取张量列表。
interpreter.get_tensor_details()根据医生的说法,
获取具有有效张量细节的每个张量的张量细节。如果没有找到所需的张量信息,则未将张量添加到列表中。这包括没有名字的临时张量。 返回:包含张量信息的字典列表。
发布于 2022-01-17 22:03:31
您可以通过可视化脚本获得所有使用过的Tensorflow Lite操作的列表。
wget -O tflite_visualize.py https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/lite/tools/visualize.py假设您的模型保存在model.tflite中,则使用下载的脚本创建html文件。
python tflite_visualize.py model.tflite model_visualization.html就在标有标签的操作一节中。

https://stackoverflow.com/questions/56325037
复制相似问题