Getting started with FCN

654 views
Skip to first unread message

Mark Sakaguchi

unread,
Jun 21, 2016, 8:16:13 PM6/21/16
to Caffe Users
Hello,

I am new to Caffe and am tackling semantic segmentation using FCNs. I downloaded the FCN models and am trying to get the pre-trained modeling working on an example image however I am running into issues. I downloaded the pascalcontext-fcn32s-heavy.caffemodel and am trying to run it on a test image similar to the Caffe ImageNet tutorial:

import numpy as np
import caffe

import pascalcontext_layers


model_def
= 'pascalcontext-fcn32s/val.prototxt'
model_weights
= 'pascalcontext-fcn32s/pascalcontext-fcn32s-heavy.caffemodel'

net
= caffe.Net(model_def, model_weights, caffe.TEST)


however I'm running into the error:

F0621 16:54:56.941515 21806 layer_factory.hpp:81] Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python (known types: AbsVal, Accuracy, ArgMax, BNLL, BatchNorm, BatchReindex, Bias, Concat, ContrastiveLoss, Convolution, Crop, Data, Deconvolution, Dropout, DummyData, ELU, Eltwise, Embed, EuclideanLoss, Exp, Filter, Flatten, HDF5Data, HDF5Output, HingeLoss, Im2col, ImageData, InfogainLoss, InnerProduct, Input, LRN, LSTM, LSTMUnit, Log, MVN, MemoryData, MultinomialLogisticLoss, PReLU, Parameter, Pooling, Power, RNN, ReLU, Reduction, Reshape, SPP, Scale, Sigmoid, SigmoidCrossEntropyLoss, Silence, Slice, Softmax, SoftmaxWithLoss, Split, TanH, Threshold, Tile, WindowData)
*** Check failure stack trace: ***


when I specify the val.prototxt file since the first layer defined is a type: "Python" layer which is a custom layer defined in "pascalcontext_layers.py" which is provided in the FCN model git repo.

Can anyone help me with this issue? Any help would be appreciated.

Also, if someone has a step-by-step guide on how to use the FCN models provided from the git repo it would be greatly appreciated. I am confused with what the "net.py" and "solve.py" function are used for for each model.

Thanks

NGUYEN Nhu Van

unread,
Jun 22, 2016, 4:04:38 AM6/22/16
to Caffe Users
You should use deploy.prototxt instead of val.prototxt. There is an example of deploy.prototxt in the folder "voc-fcn8s"

Evan Shelhamer

unread,
Jul 14, 2016, 7:40:26 PM7/14/16
to NGUYEN Nhu Van, Caffe Users
You need to compile your Caffe with Python layer turned on, by for instance uncommenting this line.

# WITH_PYTHON_LAYER := 1

Evan Shelhamer





On Wed, Jun 22, 2016 at 1:04 AM, NGUYEN Nhu Van <n.nh...@gmail.com> wrote:
You should use deploy.prototxt instead of val.prototxt. There is an example of deploy.prototxt in the folder "voc-fcn8s"

--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/68771738-4e91-435b-8a85-1a75ea9e8eb0%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages