convolutional-pose-machines-release icon indicating copy to clipboard operation
convolutional-pose-machines-release copied to clipboard

Compiling Caffe

Open jpiabrantes opened this issue 8 years ago • 10 comments

I am having problems compiling your Caffe version. It seems to a be a problem with OpenCV. I am using opencv 3.0.0 Here's the error:

joao@joao:~/github/caffe$ make all
CXX src/caffe/data_transformer.cpp
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:273:23: error: ‘vector’ does not name a type
         Octree( const vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
                       ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:273:29: error: expected ‘,’ or ‘...’ before ‘<’ token
         Octree( const vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
                             ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:276:39: error: ‘vector’ does not name a type
         virtual void buildTree( const vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
                                       ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:276:45: error: expected ‘,’ or ‘...’ before ‘<’ token
         virtual void buildTree( const vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
                                             ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:278:44: error: ‘vector’ has not been declared
                                            vector<Point3f>& points ) const;
                                            ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:278:50: error: expected ‘,’ or ‘...’ before ‘<’ token
                                            vector<Point3f>& points ) const;
                                                  ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:279:15: error: ‘vector’ does not name a type
         const vector<Node>& getNodes() const { return nodes; }
               ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:282:9: error: ‘vector’ does not name a type
         vector<Point3f> points;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:283:9: error: ‘vector’ does not name a type
         vector<Node> nodes;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:295:22: error: ‘vector’ does not name a type
         Mesh3D(const vector<Point3f>& vtx);
                      ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:295:28: error: expected ‘,’ or ‘...’ before ‘<’ token
         Mesh3D(const vector<Point3f>& vtx);
                            ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:302:35: error: ‘vector’ does not name a type
         void computeNormals(const vector<int>& subset, float normalRadius, int minNeighbors = 20);
                                   ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:302:41: error: expected ‘,’ or ‘...’ before ‘<’ token
         void computeNormals(const vector<int>& subset, float normalRadius, int minNeighbors = 20);
                                         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:304:52: error: ‘vector’ does not name a type
         void writeAsVrml(const String& file, const vector<Scalar>& colors = vector<Scalar>()) const;
                                                    ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:304:58: error: expected ‘,’ or ‘...’ before ‘<’ token
         void writeAsVrml(const String& file, const vector<Scalar>& colors = vector<Scalar>()) const;
                                                          ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:306:9: error: ‘vector’ does not name a type
         vector<Point3f> vtx;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:307:9: error: ‘vector’ does not name a type
         vector<Point3f> normals;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:338:30: error: ‘vector’ does not name a type
         void setSubset(const vector<int>& subset);
                              ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:338:36: error: expected ‘,’ or ‘...’ before ‘<’ token
         void setSubset(const vector<int>& subset);
                                    ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:341:49: error: ‘vector’ has not been declared
         void match(const SpinImageModel& scene, vector< vector<Vec2i> >& result);
                                                 ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:341:55: error: expected ‘,’ or ‘...’ before ‘<’ token
         void match(const SpinImageModel& scene, vector< vector<Vec2i> >& result);
                                                       ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:371:48: error: ‘vector’ has not been declared
         void matchSpinToModel(const Mat& spin, vector<int>& indeces,
                                                ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:371:54: error: expected ‘,’ or ‘...’ before ‘<’ token
         void matchSpinToModel(const Mat& spin, vector<int>& indeces,
                                                      ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:374:37: error: ‘vector’ does not name a type
         void repackSpinImages(const vector<uchar>& mask, Mat& spinImages, bool reAlloc = true) const;
                                     ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:374:43: error: expected ‘,’ or ‘...’ before ‘<’ token
         void repackSpinImages(const vector<uchar>& mask, Mat& spinImages, bool reAlloc = true) const;
                                           ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:376:9: error: ‘vector’ does not name a type
         vector<int> subset;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp: In member function ‘const Point3f& cv::SpinImageModel::getSpinVertex(size_t) const’:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:347:72: error: ‘const class cv::Mesh3D’ has no member named ‘vtx’
         const Point3f& getSpinVertex(size_t index) const { return mesh.vtx[subset[index]]; }
                                                                        ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:347:76: error: ‘subset’ was not declared in this scope
         const Point3f& getSpinVertex(size_t index) const { return mesh.vtx[subset[index]]; }
                                                                            ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp: In member function ‘const Point3f& cv::SpinImageModel::getSpinNormal(size_t) const’:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:348:72: error: ‘const class cv::Mesh3D’ has no member named ‘normals’
         const Point3f& getSpinNormal(size_t index) const { return mesh.normals[subset[index]]; }
                                                                        ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:348:80: error: ‘subset’ was not declared in this scope
         const Point3f& getSpinNormal(size_t index) const { return mesh.normals[subset[index]]; }
                                                                                ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp: At global scope:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:419:46: error: ‘vector’ has not been declared
         virtual void compute(const Mat& img, vector<float>& descriptors, Size winStride=Size(),
                                              ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:419:52: error: expected ‘,’ or ‘...’ before ‘<’ token
         virtual void compute(const Mat& img, vector<float>& descriptors, Size winStride=Size(),
                                                    ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:489:34: error: ‘vector’ has not been declared
         static void bundleAdjust(vector<Point3d>& points, // positions of points in global coordinate system (input and output)
                                  ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:489:40: error: expected ‘,’ or ‘...’ before ‘<’ token
         static void bundleAdjust(vector<Point3d>& points, // positions of points in global coordinate system (input and output)
                                        ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:561:42: error: ‘vector’ has not been declared
                                   CV_OUT vector<vector<Point> >& results, CV_OUT vector<float>& cost,
                                          ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:561:48: error: expected ‘,’ or ‘...’ before ‘<’ token
                                   CV_OUT vector<vector<Point> >& results, CV_OUT vector<float>& cost,
                                                ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:760:9: error: ‘vector’ does not name a type
         vector<int> Rsr;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:761:9: error: ‘vector’ does not name a type
         vector<int> Csr;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:762:9: error: ‘vector’ does not name a type
         vector<double> Wsr;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:771:13: error: ‘vector’ does not name a type
             vector<double> weights;
             ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:777:9: error: ‘vector’ does not name a type
         vector<kernel> w_ker_2D;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:841:9: error: ‘vector’ does not name a type
         vector<vector<pixel> > L;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:842:9: error: ‘vector’ does not name a type
         vector<double> A;
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:852:22: error: redefinition of ‘class cv::LDA’
     class CV_EXPORTS LDA
                      ^
In file included from /home/joao/anaconda2/include/opencv2/core/core.hpp:48:0,
                 from src/caffe/data_transformer.cpp:2:
/home/joao/anaconda2/include/opencv2/core.hpp:2380:18: error: previous definition of ‘class cv::LDA’
 class CV_EXPORTS LDA
                  ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:940:41: error: ‘string’ does not name a type
         CV_WRAP virtual void save(const string& filename) const;
                                         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:943:41: error: ‘string’ does not name a type
         CV_WRAP virtual void load(const string& filename);
                                         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:952:39: error: ‘map’ in namespace ‘std’ does not name a template type
         void setLabelsInfo(const std::map<int, string>& labelsInfo);
                                       ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:952:42: error: expected ‘,’ or ‘...’ before ‘<’ token
         void setLabelsInfo(const std::map<int, string>& labelsInfo);
                                          ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:955:9: error: ‘string’ does not name a type
         string getLabelInfo(const int &label);
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:958:9: error: ‘vector’ does not name a type
         vector<int> getLabelsByString(const string& str);
         ^
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:968:27: error: redeclaration of ‘COLORMAP_AUTUMN’
         COLORMAP_AUTUMN = 0,
                           ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3733:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_AUTUMN’
     COLORMAP_AUTUMN = 0, //!< ![autumn](pics/colormaps/colorscale_autumn.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:969:25: error: redeclaration of ‘COLORMAP_BONE’
         COLORMAP_BONE = 1,
                         ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3734:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_BONE’
     COLORMAP_BONE = 1, //!< ![bone](pics/colormaps/colorscale_bone.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:970:24: error: redeclaration of ‘COLORMAP_JET’
         COLORMAP_JET = 2,
                        ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3735:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_JET’
     COLORMAP_JET = 2, //!< ![jet](pics/colormaps/colorscale_jet.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:971:27: error: redeclaration of ‘COLORMAP_WINTER’
         COLORMAP_WINTER = 3,
                           ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3736:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_WINTER’
     COLORMAP_WINTER = 3, //!< ![winter](pics/colormaps/colorscale_winter.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:972:28: error: redeclaration of ‘COLORMAP_RAINBOW’
         COLORMAP_RAINBOW = 4,
                            ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3737:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_RAINBOW’
     COLORMAP_RAINBOW = 4, //!< ![rainbow](pics/colormaps/colorscale_rainbow.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:973:26: error: redeclaration of ‘COLORMAP_OCEAN’
         COLORMAP_OCEAN = 5,
                          ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3738:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_OCEAN’
     COLORMAP_OCEAN = 5, //!< ![ocean](pics/colormaps/colorscale_ocean.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:974:27: error: redeclaration of ‘COLORMAP_SUMMER’
         COLORMAP_SUMMER = 6,
                           ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3739:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_SUMMER’
     COLORMAP_SUMMER = 6, //!< ![summer](pics/colormaps/colorscale_summer.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:975:27: error: redeclaration of ‘COLORMAP_SPRING’
         COLORMAP_SPRING = 7,
                           ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3740:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_SPRING’
     COLORMAP_SPRING = 7, //!< ![spring](pics/colormaps/colorscale_spring.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:976:25: error: redeclaration of ‘COLORMAP_COOL’
         COLORMAP_COOL = 8,
                         ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3741:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_COOL’
     COLORMAP_COOL = 8, //!< ![cool](pics/colormaps/colorscale_cool.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:977:24: error: redeclaration of ‘COLORMAP_HSV’
         COLORMAP_HSV = 9,
                        ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3742:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_HSV’
     COLORMAP_HSV = 9, //!< ![HSV](pics/colormaps/colorscale_hsv.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:978:25: error: redeclaration of ‘COLORMAP_PINK’
         COLORMAP_PINK = 10,
                         ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3743:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_PINK’
     COLORMAP_PINK = 10, //!< ![pink](pics/colormaps/colorscale_pink.jpg)
     ^
In file included from src/caffe/data_transformer.cpp:4:0:
/home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:979:24: error: redeclaration of ‘COLORMAP_HOT’
         COLORMAP_HOT = 11
                        ^
In file included from /home/joao/anaconda2/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/imgproc.hpp:3744:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_HOT’
     COLORMAP_HOT = 11, //!< ![hot](pics/colormaps/colorscale_hot.jpg)
     ^
In file included from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:989:0,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:118:36: error: ‘vector’ does not name a type
     virtual void addTraining(const vector<Mat>& queryImgDescriptors);
                                    ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:118:42: error: expected ‘,’ or ‘...’ before ‘<’ token
     virtual void addTraining(const vector<Mat>& queryImgDescriptors);
                                          ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:122:28: error: ‘vector’ does not name a type
     virtual void add(const vector<Mat>& queryImgDescriptors);
                            ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:122:34: error: expected ‘,’ or ‘...’ before ‘<’ token
     virtual void add(const vector<Mat>& queryImgDescriptors);
                                  ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:125:11: error: ‘vector’ does not name a type
     const vector<Mat>& getTrainingImgDescriptors() const;
           ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:126:11: error: ‘vector’ does not name a type
     const vector<Mat>& getTestImgDescriptors() const;
           ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:130:13: error: ‘vector’ has not been declared
             vector<IMatch>& matches, bool addQuery = false,
             ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:130:19: error: expected ‘,’ or ‘...’ before ‘<’ token
             vector<IMatch>& matches, bool addQuery = false,
                   ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:133:44: error: ‘vector’ has not been declared
             const Mat& testImgDescriptors, vector<IMatch>& matches,
                                            ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:133:50: error: expected ‘,’ or ‘...’ before ‘<’ token
             const Mat& testImgDescriptors, vector<IMatch>& matches,
                                                  ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:136:19: error: ‘vector’ does not name a type
             const vector<Mat>& testImgDescriptors,
                   ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:136:25: error: expected ‘,’ or ‘...’ before ‘<’ token
             const vector<Mat>& testImgDescriptors,
                         ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:135:10: error: ‘void cv::of2::FabMap::compare(const cv::Mat&, int)’ cannot be overloaded
     void compare(const Mat& queryImgDescriptor,
          ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:129:10: error: with ‘void cv::of2::FabMap::compare(const cv::Mat&, int)’
     void compare(const Mat& queryImgDescriptor,
          ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:138:24: error: ‘vector’ does not name a type
     void compare(const vector<Mat>& queryImgDescriptors, vector<
                        ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:138:30: error: expected ‘,’ or ‘...’ before ‘<’ token
     void compare(const vector<Mat>& queryImgDescriptors, vector<
                              ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:141:24: error: ‘vector’ does not name a type
     void compare(const vector<Mat>& queryImgDescriptors,
                        ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:141:30: error: expected ‘,’ or ‘...’ before ‘<’ token
     void compare(const vector<Mat>& queryImgDescriptors,
                              ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:141:10: error: ‘void cv::of2::FabMap::compare(int)’ cannot be overloaded
     void compare(const vector<Mat>& queryImgDescriptors,
          ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:138:10: error: with ‘void cv::of2::FabMap::compare(int)’
     void compare(const vector<Mat>& queryImgDescriptors, vector<
          ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:148:35: error: ‘vector’ does not name a type
             int queryIndex, const vector<Mat>& testImgDescriptors,
                                   ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:148:41: error: expected ‘,’ or ‘...’ before ‘<’ token
             int queryIndex, const vector<Mat>& testImgDescriptors,
                                         ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:156:19: error: ‘vector’ does not name a type
             const vector<Mat>& testImgDescriptors,
                   ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:156:25: error: expected ‘,’ or ‘...’ before ‘<’ token
             const vector<Mat>& testImgDescriptors,
                         ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:161:32: error: ‘vector’ has not been declared
     void normaliseDistribution(vector<IMatch>& matches);
                                ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:161:38: error: expected ‘,’ or ‘...’ before ‘<’ token
     void normaliseDistribution(vector<IMatch>& matches);
                                      ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:177:5: error: ‘vector’ does not name a type
     vector<Mat> trainingImgDescriptors;
     ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:178:5: error: ‘vector’ does not name a type
     vector<Mat> testImgDescriptors;
     ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:179:5: error: ‘vector’ does not name a type
     vector<IMatch> priorMatches;
     ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:206:62: error: ‘vector’ does not name a type
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                              ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:206:68: error: expected ‘,’ or ‘...’ before ‘<’ token
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                                    ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:222:62: error: ‘vector’ does not name a type
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                              ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:222:68: error: expected ‘,’ or ‘...’ before ‘<’ token
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                                    ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:246:62: error: ‘vector’ does not name a type
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                              ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:246:68: error: expected ‘,’ or ‘...’ before ‘<’ token
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                                    ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:298:28: error: ‘vector’ does not name a type
     void addTraining(const vector<Mat>& queryImgDescriptors);
                            ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:298:34: error: expected ‘,’ or ‘...’ before ‘<’ token
     void addTraining(const vector<Mat>& queryImgDescriptors);
                                  ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:303:20: error: ‘vector’ does not name a type
     void add(const vector<Mat>& queryImgDescriptors);
                    ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:303:26: error: expected ‘,’ or ‘...’ before ‘<’ token
     void add(const vector<Mat>& queryImgDescriptors);
                          ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:308:62: error: ‘vector’ does not name a type
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                              ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:308:68: error: expected ‘,’ or ‘...’ before ‘<’ token
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                                    ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:313:61: error: ‘vector’ has not been declared
     void getIndexLikelihoods(const Mat& queryImgDescriptor, vector<
                                                             ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:313:67: error: expected ‘,’ or ‘...’ before ‘<’ token
     void getIndexLikelihoods(const Mat& queryImgDescriptor, vector<
                                                                   ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:317:13: error: ‘vector’ has not been declared
             vector<double>& defaults,
             ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:317:19: error: expected ‘,’ or ‘...’ before ‘<’ token
             vector<double>& defaults,
                   ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:321:5: error: ‘vector’ does not name a type
     vector<double> d1, d2, d3, d4;
     ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:322:5: error: ‘vector’ does not name a type
     vector<vector<int> > children;
     ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:326:5: error: ‘vector’ does not name a type
     vector<double> trainingDefaults;
     ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:327:14: error: ‘vector’ was not declared in this scope
     map<int, vector<int> > trainingInvertedMap;
              ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:327:14: note: suggested alternative:
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/joao/anaconda2/include/opencv2/core/types.hpp:53,
                 from /home/joao/anaconda2/include/opencv2/core.hpp:58,
                 from /home/joao/anaconda2/include/opencv2/core/core.hpp:48,
                 from src/caffe/data_transformer.cpp:2:
/usr/include/c++/5/bits/stl_vector.h:214:11: note:   ‘std::vector’
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^
In file included from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:989:0,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:327:24: error: template argument 2 is invalid
     map<int, vector<int> > trainingInvertedMap;
                        ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:327:24: error: template argument 4 is invalid
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:327:26: error: expected unqualified-id before ‘>’ token
     map<int, vector<int> > trainingInvertedMap;
                          ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:329:5: error: ‘vector’ does not name a type
     vector<double> testDefaults;
     ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:330:14: error: ‘vector’ was not declared in this scope
     map<int, vector<int> > testInvertedMap;
              ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:330:14: note: suggested alternative:
In file included from /usr/include/c++/5/vector:64:0,
                 from /home/joao/anaconda2/include/opencv2/core/types.hpp:53,
                 from /home/joao/anaconda2/include/opencv2/core.hpp:58,
                 from /home/joao/anaconda2/include/opencv2/core/core.hpp:48,
                 from src/caffe/data_transformer.cpp:2:
/usr/include/c++/5/bits/stl_vector.h:214:11: note:   ‘std::vector’
     class vector : protected _Vector_base<_Tp, _Alloc>
           ^
In file included from /home/joao/anaconda2/include/opencv2/contrib/contrib.hpp:989:0,
                 from src/caffe/data_transformer.cpp:4:
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:330:24: error: template argument 2 is invalid
     map<int, vector<int> > testInvertedMap;
                        ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:330:24: error: template argument 4 is invalid
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:330:26: error: expected unqualified-id before ‘>’ token
     map<int, vector<int> > testInvertedMap;
                          ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:345:20: error: ‘vector’ does not name a type
     void add(const vector<Mat>& imgDescriptors);
                    ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:345:26: error: expected ‘,’ or ‘...’ before ‘<’ token
     void add(const vector<Mat>& imgDescriptors);
                          ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:347:11: error: ‘vector’ does not name a type
     const vector<Mat>& getImgDescriptors() const;
           ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:352:5: error: ‘vector’ does not name a type
     vector<Mat> imgDescriptors;
     ^
/home/joao/anaconda2/include/opencv2/contrib/openfabmap.hpp:378:5: error: ‘vector’ does not name a type
     vector<int> extractChildren(list<info> &remaining_edges, int q);
     ^
Makefile:552: recipe for target '.build_release/src/caffe/data_transformer.o' failed
make: *** [.build_release/src/caffe/data_transformer.o] Error 1

jpiabrantes avatar May 27 '16 10:05 jpiabrantes

The caffe was forked from earlier versions, so it may be not compatible with opencv 3. The long term solution would be merging our caffe with more recent caffe, but for short-term I would suggest build an earlier opencv (I was using 2.4.10) without "sudo make install" to avoid conflicting your original use of opencv 3, and point caffe to the location you build it in Makefile.config (add stuff at the head of INCLUDE_DIRS and LIBRARY_DIRS).

I succeeded compiling with doing this on a machine with installed opencv 3, but with default python. There might be further problems to solve with anaconda.

shihenw avatar May 27 '16 11:05 shihenw

Thanks. I was able to fix the problem with OpenCV. I now receive another error that I think it's related with my cuDNN version.

joao@joao:~/github/caffe-shen$ make test -j8
NVCC src/caffe/layers/cudnn_conv_layer.cu
src/caffe/layers/cudnn_conv_layer.cu(33): error: argument of type "cudnnAddMode_t" is incompatible with parameter of type "const void *"
          detected during instantiation of "void caffe::CuDNNConvolutionLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=float]" 
(115): here

src/caffe/layers/cudnn_conv_layer.cu(33): error: argument of type "const void *" is incompatible with parameter of type "cudnnTensorDescriptor_t"
          detected during instantiation of "void caffe::CuDNNConvolutionLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=float]" 
(115): here

src/caffe/layers/cudnn_conv_layer.cu(33): error: argument of type "const void *" is incompatible with parameter of type "cudnnTensorDescriptor_t"
          detected during instantiation of "void caffe::CuDNNConvolutionLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=float]" 
(115): here

src/caffe/layers/cudnn_conv_layer.cu(33): error: too many arguments in function call
          detected during instantiation of "void caffe::CuDNNConvolutionLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=float]" 
(115): here

src/caffe/layers/cudnn_conv_layer.cu(33): error: argument of type "cudnnAddMode_t" is incompatible with parameter of type "const void *"
          detected during instantiation of "void caffe::CuDNNConvolutionLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=double]" 
(115): here

src/caffe/layers/cudnn_conv_layer.cu(33): error: argument of type "const void *" is incompatible with parameter of type "cudnnTensorDescriptor_t"
          detected during instantiation of "void caffe::CuDNNConvolutionLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=double]" 
(115): here

src/caffe/layers/cudnn_conv_layer.cu(33): error: argument of type "const void *" is incompatible with parameter of type "cudnnTensorDescriptor_t"
          detected during instantiation of "void caffe::CuDNNConvolutionLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=double]" 
(115): here

src/caffe/layers/cudnn_conv_layer.cu(33): error: too many arguments in function call
          detected during instantiation of "void caffe::CuDNNConvolutionLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &, const std::vector<caffe::Blob<Dtype> *, std::allocator<caffe::Blob<Dtype> *>> &) [with Dtype=double]" 
(115): here

8 errors detected in the compilation of "/tmp/tmpxft_00006036_00000000-16_cudnn_conv_layer.compute_50.cpp1.ii".
Makefile:567: recipe for target '.build_release/cuda/src/caffe/layers/cudnn_conv_layer.o' failed
make: *** [.build_release/cuda/src/caffe/layers/cudnn_conv_layer.o] Error 1

I am using Cuda 7.5 and cudNN 5. Which ones did you use?

jpiabrantes avatar May 30 '16 14:05 jpiabrantes

I was using cuda 7.5 and cudnn 3.

shihenw avatar Jun 01 '16 05:06 shihenw

Could you let me know how did you solve the earlier problem ? I'm having the same problem now.

congwang1985 avatar Jul 30 '16 03:07 congwang1985

Please see this. https://github.com/Nerei/kinfu_remake/issues/8 It worked for me.

ShangxuanWu avatar Nov 18 '16 21:11 ShangxuanWu

@ShangxuanWu Please let me know what worked for you. The link is not found. @jpiabrantes @congwang1985 Have you solved this issue? If so, please share the solution...

@shihenw Hey, I've got the same issue when compiling your caffe. By using opencv 3.2, your caffe is not compiled with 'make all' command, so I tried to use nvidia caffe now. For using opencv 2.4.x with your caffe, could you tell me more details for pointing opencv 2.4.x build location in Makefile.config file? I comment # OPENCV_VERSION := 3, and I put INCLUDE_DIRS+= /home/handale/opencv-2.4.13/include, LIBRARY_DIRS += /home/handale/opencv-2.4.13/release/lib Is this supposed to be right? It's not working.. so I wonder if there is another way to do it. Also, I am wondering which matlab version you are using. When I use Matlab 2014b with nvidia-caffe and opencv3.2, imshow doesn't really show the image corretly so it's difficult to make bounding box in the image. Please let me know which matlab version you are using. Thanks!

handale88 avatar Apr 30 '17 13:04 handale88

hi, I got the same issue and can't complete building caffe src/caffe/CMakeFiles/caffe.dir/build.make:883: recipe for target 'src/caffe/CMakeFiles/caffe.dir/layers/euclidean_loss_layer.cpp.o' failed make[2]: *** [src/caffe/CMakeFiles/caffe.dir/layers/euclidean_loss_layer.cpp.o] Error 1 make[2]: *** Waiting for unfinished jobs.... CMakeFiles/Makefile2:272: recipe for target 'src/caffe/CMakeFiles/caffe.dir/all' failed make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2 Makefile:127: recipe for target 'all' failed make: *** [all] Error 2

vector<Mat> imgDescriptors; ^ /usr/include/opencv2/contrib/openfabmap.hpp:378:5: error: ‘vector’ does not name a type vector extractChildren(list &remaining_edges, int q); ^

I building with opencv3.0 @shihenw @ShangxuanWu @congwang1985 @handale88 @jpiabrantes please help me,thanks!

oujieww avatar Aug 27 '17 06:08 oujieww

I find the solution from some one else, just remove the contrib module in the Makefile and uncomment the contrib.hpp in some files used the *hpp and make all

hongge831 avatar Apr 02 '18 03:04 hongge831

This is similar to above answers.

  1. First edit here and remove contrib from the components and make sure it uses opencv 3 (can also replace QUIET with REQUIRED )
  2. Execute this to comment the contrib header from all files: find caffe/src/caffe/ -type f -print0 | xargs -0 sed -i 's/#include <opencv2\/contrib\/contrib.hpp>/\/\/#include <opencv2\/contrib\/contrib.hpp>/g'

ayushgaud avatar Jul 04 '18 17:07 ayushgaud

I had the same error. My solution was: Change from Opencv 3.3 to 2.4.8 by entering 2.4.8`s build. then sudo make install

snakehaihai avatar Dec 21 '18 13:12 snakehaihai