对于python2
- pip install pydot
- pip install graphviz
- 下载graphviz安装(graphviz-2.38.msi),并添加环境变量
- 修改python/caffe/draw.py,将pydot.graphviz.find_graphviz改成pydot.find_graphviz
- 修改C:\ProgramData\Anaconda2\Lib\site-packages\pydot__init__.py,将def find_graphviz():函数修改为:
def find_graphviz():
path = r"C:\Program Files (x86)\Graphviz2.38\bin"
print("### Kang>>> graphviz path: " + path + " >> with platform: " + os.sys.platform)
progs = __find_executables(path)
if progs is not None:
print("Used default install location")
return progs
# Failed to find GraphViz
print("Failed to find GraphViz")
return None
对于python3
- pip install pydotplus
- pip install graphviz
- 下载graphviz安装(graphviz-2.38.msi),并添加环境变量
使用
cd %caffe_root%
python python\draw_net.py examples\mnist\lenet_train_test.prototxt testDraw.png
在%caffe_root%目录下生成testDraw.png文件