Caffe-LMDBCreation-MultiLabel icon indicating copy to clipboard operation
Caffe-LMDBCreation-MultiLabel copied to clipboard

why label sholud be [0 255]

Open zack6514 opened this issue 6 years ago • 5 comments

I have 4 classes and assign 0 0 1 1 to it , and in train.prototxt label data not have the param scale , I think this is ok? why should be [0 255]?

zack6514 avatar Sep 02 '17 14:09 zack6514

We are using data layer for labels. Data layer in Caffe automatically scales down by a factor of 255. Thats why labels should be in the scale of [0, 255], so that after scaling, you should have proper values between 0 and 1 !!

sukritshankar avatar Sep 06 '17 10:09 sukritshankar

Hi @sukritshankar ,

Can you give more information on creating .mat file labels. How to create the .mat file? It would be helpful if you could help me for the same as i am new to caffe framework.

Thanks and Regards

vishalghor avatar Oct 06 '17 06:10 vishalghor

@sukritshankar I believe its the code in prototxt https://github.com/sukritshankar/Caffe-LMDBCreation-MultiLabel/blob/f4a92fcf4282ea808cd3c6bb5ade2712e23d2dbf/train_vgg_11_sigmoid_cross_entropy_loss.prototxt#L43 due to which caffe will scale down the labels by 255. Thus if we eliminate this line of code should labels of the form [0, 1] not be directly useful. Without having to scale them up by 255.

aniket03 avatar Dec 06 '17 12:12 aniket03

Hi, @sukritshankar any updated on above?

aniket03 avatar Jan 09 '18 09:01 aniket03

@aniket03 Agree! If your labels are 0 ,1, then it should work to eliminate this line.

iiwindii avatar Apr 23 '18 03:04 iiwindii