how to show all the names of caffe layers in python?

157 Views Asked by At

I am creating some customized layers so that I want to checkout caffe is built successfully or not. can anyone tell me how to show all the names of the layers in python3

I am using python3.6 and building from the latest version of caffe

1

There are 1 best solutions below

0
Roger Figueroa Quintero On

Locate the directory path_caffe where are stored the python files of caffe, you should see caffe folder classify.py and the files CMakeLists.txt, detect.py, draw_net.py, requirements.txt and train.py. Then locate the file .prototxt of you model path_model. Finally replace in the following code:

path_caffe = "path/to/caffe/python"
import sys
sys.path.append(path_caffe)

import caffe


path_model = "path/to/model.prototxt" 
net = caffe.Net(path_model, caffe.TEST)

for key in net.layer_dict:

    print(key)