Errors while using MatConvNet for semantic segmentation

997 views
Skip to first unread message

Omry Sendik

unread,
Dec 11, 2015, 7:30:56 AM12/11/15
to MatConvNet: CNNs for MATLAB
Hi,

I am trying to use the pre-trained model for semantic segmentation ("Fully Convolutional Networks for Semantic Segmentation").

It seems that the testing function requires a file named "data/fcn32-voc11/net-epoch-50.mat".
I tried replacing it by any of the pre-trained networks on the website but none of them work.
I tried:

  1.     pascal-fcn32s-dag
  2.     pascal-fcn16s-dag
  3.     pascal-fcn8s-dag

Can you please let me know either where to find the net-epoch-50.mat or something else which I am doing wrong?

Thanks,
Omry

Omry Sendik

unread,
Dec 12, 2015, 12:06:45 PM12/12/15
to MatConvNet: CNNs for MATLAB
Hi again,

I was able to get through some of the basic malfunctions but now I seem to be stuck on something crucial and need a hand.

I get an error in fcnTest row 144 (which states:   net.eval({inputVar, im_}) ;)

Error using vl_nnconvt
FILTERS are larger than the outoput (including cropding).

This makes me think that importing the model was done improperly (I am running fcnTestModelZoo which calls fcnTest).

Any guess what am I doing wrong?



בתאריך יום שישי, 11 בדצמבר 2015 בשעה 14:30:56 UTC+2, מאת Omry Sendik:

Sig

unread,
Jan 26, 2016, 12:32:54 PM1/26/16
to MatConvNet: CNNs for MATLAB
Hi Omry,

I am experiencing the same problems as you did with fcn. 

Have you managed to solve the problems your reported in this thread?
Please, tell us whether you have useful information to run fcntest.

Thanks
Sig

Omry Sendik

unread,
Jan 27, 2016, 3:49:34 AM1/27/16
to MatConvNet: CNNs for MATLAB
Hi,

I was able to solve this problem by applying a fix to the network's structure inside the initialization function.
Please add the following rows inside fcnInitializeModel.m (and/or fcnInitializeModel16s.m fcnInitializeModel8.m)

% Modify the last fully-connected layer to have 3 output classes
% Initialize the new filters to zero
Biases = 0;
OSFix = 1;
for i = net.getParamIndex(net.layers(end-1).params) ;
  sz = size(net.params(i).value) ;
  if(~OSFix)
      sz(end) = 3 ;
  else
      if(~Biases)
          sz(end) = 3 ;
      else
          sz(end-1) = 3 ;
      end
  end
  net.params(i).value = zeros(sz, 'single') ;
  Biases = 1;
end

I hope this helps!
Omry

בתאריך יום שלישי, 26 בינואר 2016 בשעה 19:32:54 UTC+2, מאת Sig:

Somayeh Molaei

unread,
Feb 9, 2016, 11:28:56 AM2/9/16
to MatConvNet: CNNs for MATLAB
Hi Omry,
I was wondering how you fixed the error "Unable to read file 'data/fcn32-voc11/net-epoch-50.mat'. No such file or directory.
" that you already faced to?
I'm trying run fcnTest to segment some medical data.
It would be great if you share your experience with me.
Thanks,
Somayeh

Omry Sendik

unread,
Feb 11, 2016, 6:07:47 AM2/11/16
to MatConvNet: CNNs for MATLAB
Hi Somayeh,

Yes, I was able to solve this by replacing this load with the pre-trained VGG-16 model from the MatConvNet website.
Note that such files (net-epoch-??.mat) are the usual name MatConvNet gives to the results of the output net after each epoch.
Hence, I assume this row was left there mistakenly when the implementors were training and loaded a result they previously achieved.
That's why you can replace this with the pretrained file found online.

Hope this helps,
Omry

בתאריך יום שלישי, 9 בפברואר 2016 בשעה 18:28:56 UTC+2, מאת Somayeh Molaei:

sriram narayanan

unread,
Feb 29, 2016, 12:53:50 AM2/29/16
to MatConvNet: CNNs for MATLAB
Hi Omry, 

Did you manage to find the fix for 
Error in fcnTest (line 140)
  net.eval({inputVar, im_}) ;

sriram narayanan

unread,
Feb 29, 2016, 12:54:30 AM2/29/16
to MatConvNet: CNNs for MATLAB
Thanks in advance. :) 

Omry Sendik

unread,
Mar 5, 2016, 4:32:52 AM3/5/16
to MatConvNet: CNNs for MATLAB
Hi,

Sorry for the slow response...
This line works for me.
Just make sure you're running a line with the following: "net = dagnn.DagNN.loadobj"

Thanks,
Omry


בתאריך יום שני, 29 בפברואר 2016 בשעה 07:54:30 UTC+2, מאת sriram narayanan:

fmi...@gmail.com

unread,
Jun 13, 2016, 4:54:27 PM6/13/16
to MatConvNet: CNNs for MATLAB
Hi Omry,

I was trying to see the semantic segmentation results for a test image like peppers.png using pretrained models like, pascal-fcn16s-dag.mat. fcnTest.m seems to perform class based segmentation, as vocSetup.m uses 20 predefined classes, but I was wondering if it is possible to label semantically similar regions using this code.  Were you able to get this working?

Thank you!
Reply all
Reply to author
Forward
0 new messages