def write_prototxt(output_file,prototxt):
''' Write prototxt to file.
Usage: write_prototxt(output_file,prototxt_dictionary) '''
with open(output_file,'w') as f:
if 'name' in prototxt.keys():
f.write('name: \"'+prototxt['name']+'\" \n')
if 'layer' in prototxt.keys():
f.write(get_prototxt_string(prototxt['layer'],0,'layer').replace('\n\n','\n'))
评论列表
文章目录