进入$CAFFE_ROOT/python:

$ python draw_net.py ../models/bvlc_reference_caffenet/train_val.prototxt caffenet.jpg

若出现错误:

Traceback (most recent call last):
File "draw_net.py", line 8, in
import caffe
File "/home/zzq/下载/caffe-master/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File "/home/zzq/下载/caffe-master/python/caffe/pycaffe.py", line 13, in
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver,
ImportError: /home/zzq/anaconda2/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/zzq/下载/caffe-master/python/caffe/_caffe.so)

出现该问题的原因是

/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found

检查一下是否真的缺少该文件:

$ strings /home/zzq/anaconda2/bin/../lib/libstdc++.so.6 | grep GLIBCXX

GLIBCXX_3.4
......
GLIBCXX_3.4.19//未找到GLIBCXX_3.4.21

命令化输入:
conda install libgcc

再次检查:

$ strings /home/zzq/anaconda2/bin/../lib/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_DEBUG_MESSAGE_LENGTH
GLIBCXX_3.4
......
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21

05-11 17:45