How is network output serialized in C++?

21 views
Skip to first unread message

E Sexton

unread,
May 14, 2018, 2:37:55 PM5/14/18
to Caffe Users
I have a fully convolutional network doing image segmentation but haven't been able to get the output deserialized into an image.  For an N x M image and C classes, I get a flattened array [(N*M*C) x 1] after a forward pass.  How is this output serialized?  Are the first four entries pixels [0,0] for classes 0:3, or are the first (N*M) pixels the full heatmap for the first class?

Przemek D

unread,
Aug 20, 2018, 8:36:38 AM8/20/18
to Caffe Users
Caffe stores all data in a serial form internally. Blobs typically have dimension NCHW, indexed from the end: so when you continuously offset your position by 1 you travel in W dimension first, then H, then C and N (i.e. to get to the same pixel in the next channel, you need to offset yourself by H*W).
Hard to give a precise answer to your question since we don't know what does your network really look like (why flatten the image in a FCN?), but hope that gives you some direction at least.
Reply all
Reply to author
Forward
0 new messages