Caffe: CNN Net Drawing

I used python code to create the Net defined in the prototext file, like:

python draw_net.py test.protxt test.png 

Does not work. It does not show any errors, but the result of test.png is a white empty image file. Can someone help me fix it? It really helps to quickly develop new networks.

+6
source share
2 answers

I had the same problem. Based on this thread , I was able to solve this using the old Proto syntax as suggested. For example, I had to do this:

Rename the definition of layers from layers to layer . All types of layers are renamed with caffe documentation (or proto file examples) - for example, a layer of type: CONVOLUTION - type: "Convolution" , etc. Replace the new syntax:

 blobs_lr: 1 blobs_lr: 1 weight_decay: 1 weight_decay: 0 

for

 param { name: "conv1_w" lr_mult: 1 decay_mult: 1 } param { name: "conv1_b" lr_mult: 2 decay_mult: 0 } 

Now parsing and working with new drawings are wonderful. See the sample .prototxt files in the caffe package for a better intuition of what the working proto syntax looks like.

+2
source

Somewhere in mid-2014, Caffe changed its proto definition for extensibility , which causes this problem. As a result of this change, all proto files must be updated to a newer definition.

To do this, Caffe provides the following tools in the distribute/bin/ or .build_release/tools :

  • upgrade_net_proto_binary.bin
  • upgrade_net_proto_text.bin

Here is a simple example of how to convert your proto-text file to a newer format:

 ./upgrade_net_proto_text.bin /path/to/older_proto_file /path/to/newer_ouput_proto_file 
+2
source

Source: https://habr.com/ru/post/989631/


All Articles