alexgkendall / SegNet-Tutorial

Files for a tutorial to train SegNet for road scenes using the CamVid dataset
http://mi.eng.cam.ac.uk/projects/segnet/tutorial.html
847 stars 517 forks source link

setting num_output for arbitrary dataset #94

Open lhoangan opened 7 years ago

lhoangan commented 7 years ago

I'm not sure if this is considered an issue. I am raising up here after quite some time struggling (and googling) with a hope to get some discussion (if it is a right place, otherwise my apology) or help someone who is struggling like me.

With a dataset of n+1 labels (n classes with 1 unknown ignored label), if the unknown label is the last label (like the case of CamVid, n = 11 classes (from 0 to 10) + unknown label 11), we'll set num_output: n and ignore_label : n (like the example at https://github.com/alexgkendall/SegNet-Tutorial/blob/master/Models/segnet_train.prototxt#L1523)

If the unknown label is set to 0 (like the case of SUN, unknown label 0 + 37 classes (from 1 to 37)), we'll set num_output: n+1 and ignore_label: 0 (like the example at https://github.com/alexgkendall/SegNet-Tutorial/blob/master/Example_Models/train_segnet_sun.prototxt#L1603). And depending on the num_output, we'll have to supply the corresponding number of class_weighting, i.e. n+1 lines. If the num_output is only n it'll bounce back some errors like Check failed: status == CUBLAS_STATUS_SUCCESS (11 vs. 0) CUBLAS_STATUS_MAPPING_ERROR

I'm not sure if it is a correct 'instruction', but this is what's been working so far to me. I am also not sure about the behavior of the net in the second case, more discussions are welcome

ArunJ1 commented 5 years ago

Some experts pls comment