Caffe Python Custom Layer

77 views
Skip to first unread message

Mahfujur Rahman

unread,
Sep 5, 2017, 11:23:05 PM9/5/17
to Caffe Users
I am implementing this layer (https://github.com/NVIDIA/DIGITS/tree/master/examples/python-layer). But got the following errors. Have you any idea how to solve that ?


F0906 23:14:52.106163 17437 layer_factory.hpp:69] Check failed: registry.count(type) == 0 (1 vs. 0) Layer type Log already registered.
*** Check failure stack trace: ***
    @     0x7f49a83e25cd  google::LogMessage::Fail()
    @     0x7f49a83e4433  google::LogMessage::SendToLog()
    @     0x7f49a83e215b  google::LogMessage::Flush()
    @     0x7f49a83e4e1e  google::LogMessageFatal::~LogMessageFatal()
    @     0x7f4963595396  caffe::LayerRegistry<>::AddCreator()
    @     0x7f496357807d  (unknown)
    @     0x7f49a96fe6ba  (unknown)
    @     0x7f49a96fe7cb  (unknown)
    @     0x7f49a97038e2  (unknown)
    @     0x7f49a96fe564  (unknown)
    @     0x7f49a9702da9  (unknown)
    @     0x7f4996d7ef09  (unknown)
    @     0x7f49a96fe564  (unknown)
    @     0x7f4996d7f571  (unknown)
    @     0x7f4996d7efa1  dlopen
    @     0x7f49a721588d  _PyImport_GetDynLoadFunc
    @     0x7f49a72844be  _PyImport_LoadDynamicModule
    @     0x7f49a7285300  (unknown)
    @     0x7f49a728655a  PyImport_ImportModuleLevel
    @     0x7f49a71fd698  (unknown)
    @     0x7f49a72491e3  PyObject_Call
    @     0x7f49a731f447  PyEval_CallObjectWithKeywords
    @     0x7f49a71f25c6  PyEval_EvalFrameEx
    @     0x7f49a732001c  PyEval_EvalCodeEx
    @     0x7f49a71eeb89  PyEval_EvalCode
    @     0x7f49a72831b4  PyImport_ExecCodeModuleEx
    @     0x7f49a7283b8f  (unknown)
    @     0x7f49a7285300  (unknown)
    @     0x7f49a728655a  PyImport_ImportModuleLevel
    @     0x7f49a71fd698  (unknown)
    @     0x7f49a72491e3  PyObject_Call
    @     0x7f49a731f447  PyEval_CallObjectWithKeywords

Hieu Do Trung

unread,
Sep 6, 2017, 7:35:17 AM9/6/17
to Caffe Users
From the error log, seems that you are creating a new layer with existing type, "Log"

Check the type in layer definition if it is "Log" ?

layer {
  name: "blank_square"
  type: "Python"
  bottom: "scale"

Mahfujur Rahman

unread,
Sep 7, 2017, 3:50:58 AM9/7/17
to Caffe Users
@Hieu Do Trung..... Thanks for your comment. I checked the prototxt file and it was type: "Python".

Mahfujur Rahman

unread,
Sep 7, 2017, 1:15:47 PM9/7/17
to Caffe Users
layer {
  type: 'Python'
  name: 'loss'
  top: 'py_loss'
  bottom: 'A'
  python_param {
    module: 'pyloss'
    layer: 'EuclideanLossLayer'
  }
  loss_weight: 1

}


On Wednesday, September 6, 2017 at 9:35:17 PM UTC+10, Hieu Do Trung wrote:

Mahfujur Rahman

unread,
Sep 7, 2017, 1:55:42 PM9/7/17
to Caffe Users
Solved.
Reply all
Reply to author
Forward
0 new messages