LoginSignup
4
1

More than 3 years have passed since last update.

TensorFlow Lite グラフの可視化ツール(visualize.py)がうまく動作しない場合の解決方法

Posted at

Tensorflow Lite グラフの可視化の推奨方法であるvisualize.pyについて、実行したら動かなかったので解決方法をこちらにまとめます。
Tensorflow Doc - コンバータ Python API ガイド

Graph visualization - TensorFlow 2.0 において、 TensorFlow Lite グラフの可視化で推奨されるのは visualize.py を使うことです。 GraphViz と違い、 post training quantization が施された後のグラフを可視化できます

注意、この記事は2019年7月30日に試した方法であるため今後この問題は解決されるかもしれません。

解決方法はこちらを参考にGoogleColabratoryに記述しました。
Github - Error when using TF-Lite visualizer to create the HTML file from a TF-Lite model #18857

GoogleColab - TFLite Graph Visualization

原因としてはvisualize.py が参照している以下のファイルが存在しないため自前でコンパイルして当該ファイルを生成する必要があるというものです。

Traceback (most recent call last):
  File "./tensorflow/tensorflow/lite/tools/visualize.py", line 47, in <module>
    raise RuntimeError("Sorry, flatc is not available at %r" % _BINARY)
RuntimeError: Sorry, flatc is not available at './tensorflow/tensorflow/lite/tools/../../../../flatbuffers/flatc'
4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1