1. caffe深度学习网络(.prototxt)在线可视化工具:NetscopeEditor


网址:http://ethereon.github.io/netscope/#/editor  

 

将.prototxt中的内容输入到文本框中,然后按shift+enter键,就会得到可视化网络,如:


2.如何对prototxt文件绘制网络的结构图

pip install pydotplus(需要安装pydotplus这个package) 
在containter的bash中,利用:

python caffe/python/draw_net.py workspace/prettynet.prototxt workspace/prettynet.jpg
   
   
  • 1

workspace/prettynet.prototxt:prototxt文件 
workspace/prettynet.jpg:目标ipg的名字(及位置)

或者是代码

# Load the module
import caffe
import caffe.draw
from caffe.proto import caffe_pb2
from google.protobuf import text_format

# Set the parameters
input_net_proto_file = 'test_net.prototxt' # net configuration file
output_image_file ='test_net.jpg' # the output image
rankdir ='LR' # net arrange method: LR、TB、RL

# Read the net
net = caffe_pb2.NetParameter()
text_format.Merge(open(input_net_proto_file).read(), net)

# Draw the net
print('Drawing net to %s' % output_image_file)
caffe.draw.draw_net_to_file(net, output_image_file, rankdir)
print('done...')
Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐