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

Reducing number of classes in SegNet #111

Open shivamsardana opened 6 years ago

shivamsardana commented 6 years ago

I want to reduce number of classes in SegNet. How can I do this to change number of classes from 11 to 4?

cacgs commented 6 years ago

Change the num_output to 4 in the last convolutional layer, remove the extra class_weighting in the loss layer.

shivamsardana commented 6 years ago

I did the same as you guided @cacgs @alexgkendall

I0728 19:33:16.611879 12075 solver.cpp:42] Solver scaffolding done. I0728 19:33:16.611939 12075 solver.cpp:250] Solving segnet I0728 19:33:16.611948 12075 solver.cpp:251] Learning Rate Policy: step Aborted at 1501250597 (unix time) try "date -d @1501250597" if you are using GNU date PC: @ 0x7f82566327a7 (unknown) SIGSEGV (@0x3f800010) received by PID 12075 (TID 0x7f8257a3e9c0) from PID 1065353232; stack trace: @ 0x7f82565e8cb0 (unknown) @ 0x7f82566327a7 (unknown) @ 0x7f8256634ae0 (unknown) @ 0x7f8256befdad (unknown) @ 0x7f82574703cd std::vector<>::_M_insert_aux() @ 0x7f8257471b8b caffe::AccuracyLayer<>::Forward_cpu() @ 0x7f825740b2a7 caffe::Net<>::ForwardFromTo() @ 0x7f825740b717 caffe::Net<>::ForwardPrefilled() @ 0x7f825750fa95 caffe::Solver<>::Step() @ 0x7f82575103bf caffe::Solver<>::Solve() @ 0x4086d8 train() @ 0x406c71 main @ 0x7f82565d3f45 (unknown) @ 0x40721d (unknown) @ 0x0 (unknown)

This is the error I am getting, I need only road, car, pedestrian and lanes only in my output/

cacgs commented 6 years ago

I would start by double checking the train and solver files, and making sure you have your labels in the right format, that is, 1 channel images where the pixel values correspond to your class number (in your case) from 0 to 3.

shivamsardana commented 6 years ago

Hello @cacgs Thank you for your help but I am getting malloc errors when I try to train.

Raj7kumar7 commented 5 years ago

@shivamsardana where you able to solve the issue.How you did it?