Problem with running Deeplab voc12

576 views
Skip to first unread message

tm.n...@digeiz.com

unread,
Aug 5, 2016, 7:47:21 AM8/5/16
to Caffe Users
Hi everyone,
I'm having a problem with running the Deeplab-LargeFOV. Whenever i try to run run_pascal.sh, this problem will show up:


Unexpected label 38. num: 0. row: 0. col: 0
*** Check failure stack trace: ***
    @     0x7f4c62d4ddaa  (unknown)
    @     0x7f4c62d4dce4  (unknown)
    @     0x7f4c62d4d6e6  (unknown)
    @     0x7f4c62d50687  (unknown)
    @     0x7f4c6340f61e  caffe::SegAccuracyLayer<>::Forward_cpu()
    @     0x7f4c633a7481  caffe::Net<>::ForwardFromTo()
    @     0x7f4c633a77f7  caffe::Net<>::ForwardPrefilled()
    @     0x7f4c63388375  caffe::Solver<>::Step()
    @     0x7f4c63388c79  caffe::Solver<>::Solve()
    @           0x40815e  train()
    @           0x4059dc  main
    @     0x7f4c6205bf45  (unknown)
    @           0x406111  (unknown)
    @              (nil)  (unknown)
Aborted (core dumped)



Everytime with different unexpected label, i tried to ajusting more ignore_label but it doesn't seem to work.
My train.prototxt is almost the same as the file Deeplab v2 provided, only change batch_size to 4 and crop_size to 97 cause my computer is kind of weak ( Celeron G1840 - GT730 - 4 GB RAM).

Thanks for reading!

McCaffe

unread,
Sep 2, 2016, 10:03:17 AM9/2/16
to Caffe Users

You probably need to save your labels as 1 Channel png images. Where the labels are encoded with a 0-based index --> in case of voc12 you would need 21 labels correspoding to the interval [0..20] 

Ali Mousavi

unread,
Sep 12, 2016, 1:47:51 AM9/12/16
to Caffe Users
He is right. The code is checking for the labels. Your number of labels have to match the values in your png images.

Naz

unread,
Sep 14, 2016, 8:20:39 AM9/14/16
to Caffe Users, tm.n...@digeiz.com
Hi,

Did you get it fixed? I am facing similar problem. 
I have verified that my labels are single(1D) channel png images. I customized the code, as I have 3 labels for my data and modified 'prototxt' and 'NUM_LABELS' in run_pascal_strong.sh accordingly. Still, I am getting the error. Unable to figure out what is the problem. :(

Do I need to make more changes? Any help would be highly appreciated.  

Thanks.

Shuo

unread,
Oct 18, 2016, 1:36:51 AM10/18/16
to Caffe Users, tm.n...@digeiz.com
Please be noted that 'NUM_LABELS' used in the sh script is used to generate a prototxt file. You can look at the generated prototxt in config folder. You will find that 'num_output' in the last fully connected layer is the number of class. Becasue the output of last fully connected layer is passed to loss layer. You really should check your image, maybe you have more label values that you specified.

在 2016年9月14日星期三 UTC+8下午8:20:39,Naz写道:

auk

unread,
Oct 28, 2016, 10:12:17 PM10/28/16
to Caffe Users
Hi,

I have checked what you suggested. My dataset has 1 channel png images with labels 0 or 1 which I produced using same pascal colormap. I set num_output =2 (0 is for background). Still getting same error. I am just fed up of this error now. What is the next possibility for this error?

zuoxin xiahou

unread,
Dec 12, 2016, 6:10:15 AM12/12/16
to Caffe Users, tm.n...@digeiz.com
On my system, the same error I find because of the reading of *.png image(opencv auto insert filtered the png's edge)

So I just change all the label *.png image to *.bmp format, then all gone right.

在 2016年8月5日星期五 UTC+8下午7:47:21,tm.n...@digeiz.com写道:

Alexander Bridi

unread,
Oct 10, 2017, 12:28:19 PM10/10/17
to Caffe Users
Zuoxin Xiahou's solution worked for me, though only when I did the conversion in Matlab. I had previously tried it using the command line tool 'mogrify' which didn't work.

Thanks!
Reply all
Reply to author
Forward
0 new messages