• 虚函数 error LNK2001: 无法解析的外部符号 "public: virtual void __cdecl


    在虚函数后面加一对大括号

    #ifndef CAFFE_CONV_DW_LAYER_HPP_
    #define CAFFE_CONV_DW_LAYER_HPP_
    
    #include <vector>
    #include "caffe/blob.hpp"
    #include "caffe/layer.hpp"
    #include "caffe/proto/caffe.pb.h"
    
    namespace caffe {
    
    template <typename Dtype>
    class ConvolutionDepthwiseLayer : public Layer<Dtype> {
     public:
      explicit ConvolutionDepthwiseLayer(const LayerParameter& param)
          : Layer<Dtype>(param) {}
      virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
          const vector<Blob<Dtype>*>& top){};
      virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
          const vector<Blob<Dtype>*>& top){};
      virtual inline int ExactNumBottomBlobs() const { return 1; }
      virtual inline int ExactNumTopBlobs() const { return 1; }
      virtual inline const char* type() const { return "ConvolutionDepthwise"; }
     protected:
      virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
          const vector<Blob<Dtype>*>& top){};
      virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
          const vector<Blob<Dtype>*>& top){};
      virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
          const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
      virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
          const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom){};
      unsigned int kernel_h_;
      unsigned int kernel_w_;
      unsigned int stride_h_;
      unsigned int stride_w_;
      unsigned int pad_h_;
      unsigned int pad_w_;
      unsigned int dilation_h_;
      unsigned int dilation_w_;
      Blob<Dtype> weight_buffer_;
      Blob<Dtype> weight_multiplier_;
      Blob<Dtype> bias_buffer_;
      Blob<Dtype> bias_multiplier_;
    };
    
    }  // namespace caffe
    
    #endif  // CAFFE_CONV_DW_LAYER_HPP_

    $ sudo make pycaffe   出错
    CXX/LD -o python/caffe/_caffe.so python/caffe/_caffe.cpp
    python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or directory
    compilation terminated.
    Makefile:502: recipe for target 'python/caffe/_caffe.so' failed
    make: *** [python/caffe/_caffe.so] Error 1

    Makefile.config  中   加local 

    PYTHON_INCLUDE := /usr/include/python2.7 
            /usr/local/lib/python2.7/dist-packages/numpy/core/include
    #/usr/lib/python2.7/dist-packages/numpy/core/include

    重新 make pycaffe 就可以了

  • 相关阅读:
    记素质拓展
    操场边的人
    ASP.NET MVC FileResult介绍
    SQL SERVER 数据类型详解
    ASP.NET 使用Response.WriteFile方法下载文件
    Java 静态代理和动态代理
    单例模式
    设计模式六原则
    Python 单例模式
    JAVA WEB 中涉及的编解码
  • 原文地址:https://www.cnblogs.com/crazybird123/p/10369810.html
Copyright © 2020-2023  润新知