diff --git a/tensorflow/lite/g3doc/guide/faq.md b/tensorflow/lite/g3doc/guide/faq.md index 197fc2d4a8f..491e3252635 100644 --- a/tensorflow/lite/g3doc/guide/faq.md +++ b/tensorflow/lite/g3doc/guide/faq.md @@ -45,30 +45,37 @@ or file a [new one](https://github.com/tensorflow/tensorflow/issues). #### How do I determine the inputs/outputs for GraphDef protocol buffer? -The easiest way to inspect a graph from a `.pb` file is to use the +The easiest way to inspect a graph from a `.pb` file is to use +[Netron](https://github.com/lutzroeder/netron), an open-source viewer for +machine learning models. + +If Netron cannot open the graph, you can try the [summarize_graph](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/graph_transforms/README.md#inspecting-graphs) tool. -If that approach yields an error, you can visualize the GraphDef with +If the summarize_graph tool yields an error, you can visualize the GraphDef with [TensorBoard](https://www.tensorflow.org/guide/summaries_and_tensorboard) and look for the inputs and outputs in the graph. To visualize a `.pb` file, use the [`import_pb_to_tensorboard.py`](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tools/import_pb_to_tensorboard.py) script like below: -```sh +```shell python import_pb_to_tensorboard.py --model_dir --log_dir ``` #### How do I inspect a `.tflite` file? -TensorFlow Lite models can be visualized using the +[Netron](https://github.com/lutzroeder/netron) is the easiest way to visualize a +TensorFlow Lite model. + +If Netron cannot open your TensorFlow Lite model, you can try the [visualize.py](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/tools/visualize.py) script in our repository. * [Clone the TensorFlow repository](https://www.tensorflow.org/install/source) * Run the `visualize.py` script with bazel: -```sh +```shell bazel run //tensorflow/lite/tools:visualize model.tflite visualized_model.html ```