caffe prototxt文件可視化

深度學習交流QQ羣:811460433


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
  • 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...')
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章