Caffeにおけるアーキテクチャ (prototxt) の可視化(Cent OS 6.6)

Deep LearningOSSであるCaffeには,ネットワークアーキテクチャを可視化するPythonツール (draw_net.py) があります.
このdraw_net.pyを実行しようとするといくつかのエラーが出てきてしまったので,備忘録として使い方を記しておこうと思います.

まず,Pythonツールそのものは以下のようにしてビルドをすることで使えるようになります.

$ make pycaffe
次に,pipを用いてpydotとgraphvizをインストールします.
$ pip install pydot
$ pip install graphviz
しかし,この状態でdraw_net.pyを実行しようとすると,次のようなエラーが出てきてしまいました.
$ python2.7 python/draw_net.py models/bvlc_reference_caffenet/train_val.prototxt caffenet.png
Couldn't import dot_parser, loading of dot files will not be possible.
Drawing net to caffenet.png
これは,pyparsingモジュールのバージョンが2.xなのが原因らしいです.そこで,pyparsingを一旦アンインストールして,1.xをインストールし直します.これで,dot_parserがimportできない旨のエラーは解消されるはずです.
しかし,今度は次のようなエラーも出てきてしまいました.
$ python2.7 python/draw_net.py models/bvlc_reference_caffenet/train_val.prototxt caffenet.png
pydot.InvocationException: Program terminated with status: 1. stderr follows: Warning: /tmp/tmpqu8WD6:3: string ran past end of line
Error: /tmp/tmpqu8WD6:4: syntax error near line 4
context: >>> ( <<< "Softmax)" [shape=record, style=filled, fillcolor="#6495ED"];
Warning: /tmp/tmpqu8WD6:4: ambiguous "6495ED" splits into two names: "6495" and "ED"
Warning: /tmp/tmpqu8WD6:4: string ran past end of line
Warning: /tmp/tmpqu8WD6:8: string ran past end of line
Warning: /tmp/tmpqu8WD6:9: ambiguous "90EE" splits into two names: "90" and " EE"
Warning: /tmp/tmpqu8WD6:9: string ran past end of line
Warning: /tmp/tmpqu8WD6:10: string ran past end of line
Warning: /tmp/tmpqu8WD6:14: string ran past end of line
Warning: /tmp/tmpqu8WD6:15: string ran past end of line
Warning: /tmp/tmpqu8WD6:16: string ran past end of line
これは,以下のサイトによると,python/caffe/draw.py内の改行の文字コードによるものだそうです.
http://stackoverflow.com/questions/24442094/pydot-not-playing-well-with-line-breaks
draw.pyの75行目にある
separator = '\n'
separator = r'\n'
のように変更します.
こうして再度,draw_net.pyを実行したところ,エラーは出ませんでした.
$ python2.7 python/draw_net.py models/bvlc_reference_caffenet/train_val.prototxt caffenet.png
Drawing net to caffenet.png