GithubHelp home page GithubHelp logo

Comments (4)

swamiviv avatar swamiviv commented on June 16, 2024

Sorry to barge in, I am having trouble with adding this layer in the newer version of caffe. I do as the wiki (s://github.com/BVLC/caffe/wiki/Development) tells me and I end up with this error:

src/caffe/layers/bn_layer.cpp: In instantiation of ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::Creator_BNLayer(const caffe::LayerParameter&) [with Dtype = float]’:
src/caffe/layers/bn_layer.cpp:276:2:   required from here
./include/caffe/layer_factory.hpp:121:67: error: cannot allocate an object of abstract type ‘caffe::BNLayer<float>’
     return shared_ptr<Layer<Dtype> >(new type##Layer<Dtype>(param));           \
                                                                   ^
src/caffe/layers/bn_layer.cpp:276:2: note: in expansion of macro ‘REGISTER_LAYER_CLASS’
  REGISTER_LAYER_CLASS(BN);
  ^
In file included from src/caffe/layers/bn_layer.cpp:4:0:
./include/caffe/common_layers.hpp:408:7: note:   because the following virtual functions are pure within ‘caffe::BNLayer<float>’:
 class BNLayer : public Layer<Dtype> {
       ^
In file included from ./include/caffe/data_layers.hpp:16:0,
                 from ./include/caffe/common_layers.hpp:10,
                 from src/caffe/layers/bn_layer.cpp:4:
./include/caffe/layer.hpp:100:16: note:     void caffe::Layer<Dtype>::Reshape(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = float]
   virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
                ^
./include/caffe/layer.hpp:304:16: note:     void caffe::Layer<Dtype>::Forward_cpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = float]
   virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
                ^
./include/caffe/layer.hpp:320:16: note:     void caffe::Layer<Dtype>::Backward_cpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<bool>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = float]
   virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
                ^
In file included from ./include/caffe/layer.hpp:10:0,
                 from ./include/caffe/data_layers.hpp:16,
                 from ./include/caffe/common_layers.hpp:10,
                 from src/caffe/layers/bn_layer.cpp:4:
src/caffe/layers/bn_layer.cpp: In instantiation of ‘boost::shared_ptr<caffe::Layer<Dtype> > caffe::Creator_BNLayer(const caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layers/bn_layer.cpp:276:2:   required from here
./include/caffe/layer_factory.hpp:121:67: error: cannot allocate an object of abstract type ‘caffe::BNLayer<double>’
     return shared_ptr<Layer<Dtype> >(new type##Layer<Dtype>(param));           \
                                                                   ^
src/caffe/layers/bn_layer.cpp:276:2: note: in expansion of macro ‘REGISTER_LAYER_CLASS’
  REGISTER_LAYER_CLASS(BN);
  ^
In file included from src/caffe/layers/bn_layer.cpp:4:0:
./include/caffe/common_layers.hpp:408:7: note:   because the following virtual functions are pure within ‘caffe::BNLayer<double>’:
 class BNLayer : public Layer<Dtype> {
       ^
In file included from ./include/caffe/data_layers.hpp:16:0,
                 from ./include/caffe/common_layers.hpp:10,
                 from src/caffe/layers/bn_layer.cpp:4:
./include/caffe/layer.hpp:100:16: note:     void caffe::Layer<Dtype>::Reshape(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = double]
   virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
                ^
./include/caffe/layer.hpp:304:16: note:     void caffe::Layer<Dtype>::Forward_cpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = double]
   virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
                ^
./include/caffe/layer.hpp:320:16: note:     void caffe::Layer<Dtype>::Backward_cpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<bool>&, const std::vector<caffe::Blob<Dtype>*>&) [with Dtype = double]
   virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,

Any ideas as to what's going on ?

from batch_normalization.

siddharthachandra avatar siddharthachandra commented on June 16, 2024

Were you able to resolve this? I have the same issue. Thanks in advance.

from batch_normalization.

Elpidam avatar Elpidam commented on June 16, 2024

same here !!!!!!!!!!!!!
Actually I have created a layer "example_layer.cpp" and after doing all the appropriate steps I came up with this error

In instantiation of ‘boost::shared_ptrcaffe::Layer caffe::GetExampleLayer(const caffe::LayerParameter&) [with Dtype = double]’:
src/caffe/layer_factory.cpp:229:1: required from here
src/caffe/layer_factory.cpp:222:74: error: cannot allocate an object of abstract type ‘caffe::ExampleLayer’
return shared_ptr<Layer >(new ExampleLayer(param));

In layer_factory.cpp, I added:

template
shared_ptr<Layer > GetExampleLayer (const LayerParameter& param){
return shared_ptr<Layer >(new ExampleLayer(param));
}

REGISTER_LAYER_CREATOR(Example, GetExampleLayer);

from batch_normalization.

96imranahmed avatar 96imranahmed commented on June 16, 2024

Did any of you guys manage to resolve this? This has been plaguing me all day!

from batch_normalization.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.