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

Feedback to the developers #38

Closed Almo1982 closed 7 years ago

Almo1982 commented 8 years ago

Hi all, thank you very much for this great tutorial, i worked it through successfully with one exception at the end: File "./SegNet/Scripts/test_segmentation_camvid.py", line 77, in rgb_gt[:,:,1] = g_gt/255.0 ValueError: could not broadcast input array from shape (3,1,360,480) into shape (360,480)

when i comment these 3 lines out in the corresponding py-file the code runs through, but then i get a black picture :-)

I have to say i didn't train the net for the whole 10000 iterations, i stopped after 1000, just to take a first look if it works anyway. I don't think this error has to do with this, or? This seems more like an array conversion problem. Have you heard about this issue before?

One more note from my side: in your tutorial you have a little clerical error in these two lines:

python /Segnet/Scripts/compute_bn_statistics.py /SegNet/Models/segnet_train.prototxt /SegNet/Models/Training/segnet_iter_10000.caffemodel /Segnet/Models/Inference/ # compute BN statistics for SegNet python /Segnet/Scripts/compute_bn_statistics.py /SegNet/Models/segnet_basic_train.prototxt /SegNet/Models/Training/segnet_basic_iter_10000.caffemodel /Segnet/Models/Inference/ # compute BN statistics for SegNet-Basic

the marked "n"s should be written in upper case, just for information ;-)

Thank you again, i made a big progress with your tutorial for my own application.

Regards Stefan

yiyao35 commented 8 years ago

Seems your label images have 3 channels, try single channel gray images.

Almo1982 commented 8 years ago

Thank you for your Feedback...but this is the original Image data that Comes with the tutorial, so i am a Little bit confused.

Does it work for others?

Timo-hab commented 8 years ago

I got the same error. Have you trained with batchsize=3 ? I have the batch size changed in segnet_basic_inference.prototxt to 1 prior to testing.

Almo1982 commented 7 years ago

Its working now, i had to change the batch size in the interference.prototxt to 1! Thanks

saviogeorge commented 7 years ago

I had the same issue and by changing the batch size = 3 to 1 in segnet_inference.prototxt helped me, to solve the issue