CMU-Perceptual-Computing-Lab / caffe_train

Other
88 stars 55 forks source link

Compilations error since the `opencv_contrib` #6

Closed un-knight closed 7 years ago

un-knight commented 7 years ago

When I compile the caffe_train I get some error with opencv_cotrib module. Here are the error:

PROTOC src/caffe/proto/caffe.proto
CXX .build_release/src/caffe/proto/caffe.pb.cc
CXX src/caffe/parallel.cpp
CXX src/caffe/common.cpp
CXX src/caffe/syncedmem.cpp
CXX src/caffe/cpm_data_transformer.cpp
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/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 );
                       ^
/usr/include/opencv2/contrib/contrib.hpp:273:29: error: expected ‘,’ or ‘...’ before ‘<’ token
         Octree( const vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
                             ^
/usr/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 );
                                       ^
/usr/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 );
                                             ^
/usr/include/opencv2/contrib/contrib.hpp:278:44: error: ‘vector’ has not been declared
                                            vector<Point3f>& points ) const;
                                            ^
/usr/include/opencv2/contrib/contrib.hpp:278:50: error: expected ‘,’ or ‘...’ before ‘<’ token
                                            vector<Point3f>& points ) const;
                                                  ^
/usr/include/opencv2/contrib/contrib.hpp:279:15: error: ‘vector’ does not name a type
         const vector<Node>& getNodes() const { return nodes; }
               ^
/usr/include/opencv2/contrib/contrib.hpp:282:9: error: ‘vector’ does not name a type
         vector<Point3f> points;
         ^
/usr/include/opencv2/contrib/contrib.hpp:283:9: error: ‘vector’ does not name a type
         vector<Node> nodes;
         ^
/usr/include/opencv2/contrib/contrib.hpp:295:22: error: ‘vector’ does not name a type
         Mesh3D(const vector<Point3f>& vtx);
                      ^
/usr/include/opencv2/contrib/contrib.hpp:295:28: error: expected ‘,’ or ‘...’ before ‘<’ token
         Mesh3D(const vector<Point3f>& vtx);
                            ^
/usr/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);
                                   ^
/usr/include/opencv2/contrib/contrib.hpp:302:41: error: expected ‘,’ or ‘...’ before ‘<’ token
         void computeNormals(const vector<int>& subset, float normalRadius, int minNeighbors = 20);
                                         ^
/usr/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;
                                                    ^
/usr/include/opencv2/contrib/contrib.hpp:304:58: error: expected ‘,’ or ‘...’ before ‘<’ token
         void writeAsVrml(const String& file, const vector<Scalar>& colors = vector<Scalar>()) const;
                                                          ^
/usr/include/opencv2/contrib/contrib.hpp:306:9: error: ‘vector’ does not name a type
         vector<Point3f> vtx;
         ^
/usr/include/opencv2/contrib/contrib.hpp:307:9: error: ‘vector’ does not name a type
         vector<Point3f> normals;
         ^
/usr/include/opencv2/contrib/contrib.hpp:338:30: error: ‘vector’ does not name a type
         void setSubset(const vector<int>& subset);
                              ^
/usr/include/opencv2/contrib/contrib.hpp:338:36: error: expected ‘,’ or ‘...’ before ‘<’ token
         void setSubset(const vector<int>& subset);
                                    ^
/usr/include/opencv2/contrib/contrib.hpp:341:49: error: ‘vector’ has not been declared
         void match(const SpinImageModel& scene, vector< vector<Vec2i> >& result);
                                                 ^
/usr/include/opencv2/contrib/contrib.hpp:341:55: error: expected ‘,’ or ‘...’ before ‘<’ token
         void match(const SpinImageModel& scene, vector< vector<Vec2i> >& result);
                                                       ^
/usr/include/opencv2/contrib/contrib.hpp:371:48: error: ‘vector’ has not been declared
         void matchSpinToModel(const Mat& spin, vector<int>& indeces,
                                                ^
/usr/include/opencv2/contrib/contrib.hpp:371:54: error: expected ‘,’ or ‘...’ before ‘<’ token
         void matchSpinToModel(const Mat& spin, vector<int>& indeces,
                                                      ^
/usr/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;
                                     ^
/usr/include/opencv2/contrib/contrib.hpp:374:43: error: expected ‘,’ or ‘...’ before ‘<’ token
         void repackSpinImages(const vector<uchar>& mask, Mat& spinImages, bool reAlloc = true) const;
                                           ^
/usr/include/opencv2/contrib/contrib.hpp:376:9: error: ‘vector’ does not name a type
         vector<int> subset;
         ^
/usr/include/opencv2/contrib/contrib.hpp: In member function ‘const Point3f& cv::SpinImageModel::getSpinVertex(size_t) const’:
/usr/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]]; }
                                                                        ^
/usr/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]]; }
                                                                            ^
/usr/include/opencv2/contrib/contrib.hpp: In member function ‘const Point3f& cv::SpinImageModel::getSpinNormal(size_t) const’:
/usr/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]]; }
                                                                        ^
/usr/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]]; }
                                                                                ^
/usr/include/opencv2/contrib/contrib.hpp: At global scope:
/usr/include/opencv2/contrib/contrib.hpp:382:22: error: redefinition of ‘class cv::TickMeter’
     class CV_EXPORTS TickMeter
                      ^
In file included from /usr/local/include/opencv2/core.hpp:3216:0,
                 from /usr/local/include/opencv2/core/core.hpp:48,
                 from src/caffe/cpm_data_transformer.cpp:2:
/usr/local/include/opencv2/core/utility.hpp:286:20: error: previous definition of ‘class cv::TickMeter’
 class CV_EXPORTS_W TickMeter
                    ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/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(),
                                              ^
/usr/include/opencv2/contrib/contrib.hpp:419:52: error: expected ‘,’ or ‘...’ before ‘<’ token
         virtual void compute(const Mat& img, vector<float>& descriptors, Size winStride=Size(),
                                                    ^
/usr/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)
                                  ^
/usr/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)
                                        ^
/usr/include/opencv2/contrib/contrib.hpp:561:42: error: ‘vector’ has not been declared
                                   CV_OUT vector<vector<Point> >& results, CV_OUT vector<float>& cost,
                                          ^
/usr/include/opencv2/contrib/contrib.hpp:561:48: error: expected ‘,’ or ‘...’ before ‘<’ token
                                   CV_OUT vector<vector<Point> >& results, CV_OUT vector<float>& cost,
                                                ^
/usr/include/opencv2/contrib/contrib.hpp:760:9: error: ‘vector’ does not name a type
         vector<int> Rsr;
         ^
/usr/include/opencv2/contrib/contrib.hpp:761:9: error: ‘vector’ does not name a type
         vector<int> Csr;
         ^
/usr/include/opencv2/contrib/contrib.hpp:762:9: error: ‘vector’ does not name a type
         vector<double> Wsr;
         ^
/usr/include/opencv2/contrib/contrib.hpp:771:13: error: ‘vector’ does not name a type
             vector<double> weights;
             ^
/usr/include/opencv2/contrib/contrib.hpp:777:9: error: ‘vector’ does not name a type
         vector<kernel> w_ker_2D;
         ^
/usr/include/opencv2/contrib/contrib.hpp:841:9: error: ‘vector’ does not name a type
         vector<vector<pixel> > L;
         ^
/usr/include/opencv2/contrib/contrib.hpp:842:9: error: ‘vector’ does not name a type
         vector<double> A;
         ^
/usr/include/opencv2/contrib/contrib.hpp:852:22: error: redefinition of ‘class cv::LDA’
     class CV_EXPORTS LDA
                      ^
In file included from /usr/local/include/opencv2/core/core.hpp:48:0,
                 from src/caffe/cpm_data_transformer.cpp:2:
/usr/local/include/opencv2/core.hpp:2468:18: error: previous definition of ‘class cv::LDA’
 class CV_EXPORTS LDA
                  ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:940:41: error: ‘string’ does not name a type
         CV_WRAP virtual void save(const string& filename) const;
                                         ^
/usr/include/opencv2/contrib/contrib.hpp:943:41: error: ‘string’ does not name a type
         CV_WRAP virtual void load(const string& filename);
                                         ^
/usr/include/opencv2/contrib/contrib.hpp:960:27: error: redeclaration of ‘COLORMAP_AUTUMN’
         COLORMAP_AUTUMN = 0,
                           ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4080:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_AUTUMN’
     COLORMAP_AUTUMN = 0, //!< ![autumn](pics/colormaps/colorscale_autumn.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:961:25: error: redeclaration of ‘COLORMAP_BONE’
         COLORMAP_BONE = 1,
                         ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4081:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_BONE’
     COLORMAP_BONE = 1, //!< ![bone](pics/colormaps/colorscale_bone.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:962:24: error: redeclaration of ‘COLORMAP_JET’
         COLORMAP_JET = 2,
                        ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4082:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_JET’
     COLORMAP_JET = 2, //!< ![jet](pics/colormaps/colorscale_jet.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:963:27: error: redeclaration of ‘COLORMAP_WINTER’
         COLORMAP_WINTER = 3,
                           ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4083:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_WINTER’
     COLORMAP_WINTER = 3, //!< ![winter](pics/colormaps/colorscale_winter.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:964:28: error: redeclaration of ‘COLORMAP_RAINBOW’
         COLORMAP_RAINBOW = 4,
                            ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4084:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_RAINBOW’
     COLORMAP_RAINBOW = 4, //!< ![rainbow](pics/colormaps/colorscale_rainbow.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:965:26: error: redeclaration of ‘COLORMAP_OCEAN’
         COLORMAP_OCEAN = 5,
                          ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4085:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_OCEAN’
     COLORMAP_OCEAN = 5, //!< ![ocean](pics/colormaps/colorscale_ocean.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:966:27: error: redeclaration of ‘COLORMAP_SUMMER’
         COLORMAP_SUMMER = 6,
                           ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4086:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_SUMMER’
     COLORMAP_SUMMER = 6, //!< ![summer](pics/colormaps/colorscale_summer.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:967:27: error: redeclaration of ‘COLORMAP_SPRING’
         COLORMAP_SPRING = 7,
                           ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4087:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_SPRING’
     COLORMAP_SPRING = 7, //!< ![spring](pics/colormaps/colorscale_spring.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:968:25: error: redeclaration of ‘COLORMAP_COOL’
         COLORMAP_COOL = 8,
                         ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4088:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_COOL’
     COLORMAP_COOL = 8, //!< ![cool](pics/colormaps/colorscale_cool.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:969:24: error: redeclaration of ‘COLORMAP_HSV’
         COLORMAP_HSV = 9,
                        ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4089:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_HSV’
     COLORMAP_HSV = 9, //!< ![HSV](pics/colormaps/colorscale_hsv.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:970:25: error: redeclaration of ‘COLORMAP_PINK’
         COLORMAP_PINK = 10,
                         ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4090:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_PINK’
     COLORMAP_PINK = 10, //!< ![pink](pics/colormaps/colorscale_pink.jpg)
     ^
In file included from src/caffe/cpm_data_transformer.cpp:4:0:
/usr/include/opencv2/contrib/contrib.hpp:971:24: error: redeclaration of ‘COLORMAP_HOT’
         COLORMAP_HOT = 11
                        ^
In file included from /usr/local/include/opencv2/imgproc/imgproc.hpp:48:0,
                 from /usr/include/opencv2/contrib/contrib.hpp:47,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/local/include/opencv2/imgproc.hpp:4091:5: note: previous declaration ‘cv::ColormapTypes COLORMAP_HOT’
     COLORMAP_HOT = 11, //!< ![hot](pics/colormaps/colorscale_hot.jpg)
     ^
In file included from /usr/include/opencv2/contrib/contrib.hpp:981:0,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/include/opencv2/contrib/openfabmap.hpp:118:36: error: ‘vector’ does not name a type
     virtual void addTraining(const vector<Mat>& queryImgDescriptors);
                                    ^
/usr/include/opencv2/contrib/openfabmap.hpp:118:42: error: expected ‘,’ or ‘...’ before ‘<’ token
     virtual void addTraining(const vector<Mat>& queryImgDescriptors);
                                          ^
/usr/include/opencv2/contrib/openfabmap.hpp:122:28: error: ‘vector’ does not name a type
     virtual void add(const vector<Mat>& queryImgDescriptors);
                            ^
/usr/include/opencv2/contrib/openfabmap.hpp:122:34: error: expected ‘,’ or ‘...’ before ‘<’ token
     virtual void add(const vector<Mat>& queryImgDescriptors);
                                  ^
/usr/include/opencv2/contrib/openfabmap.hpp:125:11: error: ‘vector’ does not name a type
     const vector<Mat>& getTrainingImgDescriptors() const;
           ^
/usr/include/opencv2/contrib/openfabmap.hpp:126:11: error: ‘vector’ does not name a type
     const vector<Mat>& getTestImgDescriptors() const;
           ^
/usr/include/opencv2/contrib/openfabmap.hpp:130:13: error: ‘vector’ has not been declared
             vector<IMatch>& matches, bool addQuery = false,
             ^
/usr/include/opencv2/contrib/openfabmap.hpp:130:19: error: expected ‘,’ or ‘...’ before ‘<’ token
             vector<IMatch>& matches, bool addQuery = false,
                   ^
/usr/include/opencv2/contrib/openfabmap.hpp:133:44: error: ‘vector’ has not been declared
             const Mat& testImgDescriptors, vector<IMatch>& matches,
                                            ^
/usr/include/opencv2/contrib/openfabmap.hpp:133:50: error: expected ‘,’ or ‘...’ before ‘<’ token
             const Mat& testImgDescriptors, vector<IMatch>& matches,
                                                  ^
/usr/include/opencv2/contrib/openfabmap.hpp:136:19: error: ‘vector’ does not name a type
             const vector<Mat>& testImgDescriptors,
                   ^
/usr/include/opencv2/contrib/openfabmap.hpp:136:25: error: expected ‘,’ or ‘...’ before ‘<’ token
             const vector<Mat>& testImgDescriptors,
                         ^
/usr/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,
          ^
/usr/include/opencv2/contrib/openfabmap.hpp:129:10: error: with ‘void cv::of2::FabMap::compare(const cv::Mat&, int)’
     void compare(const Mat& queryImgDescriptor,
          ^
/usr/include/opencv2/contrib/openfabmap.hpp:138:24: error: ‘vector’ does not name a type
     void compare(const vector<Mat>& queryImgDescriptors, vector<
                        ^
/usr/include/opencv2/contrib/openfabmap.hpp:138:30: error: expected ‘,’ or ‘...’ before ‘<’ token
     void compare(const vector<Mat>& queryImgDescriptors, vector<
                              ^
/usr/include/opencv2/contrib/openfabmap.hpp:141:24: error: ‘vector’ does not name a type
     void compare(const vector<Mat>& queryImgDescriptors,
                        ^
/usr/include/opencv2/contrib/openfabmap.hpp:141:30: error: expected ‘,’ or ‘...’ before ‘<’ token
     void compare(const vector<Mat>& queryImgDescriptors,
                              ^
/usr/include/opencv2/contrib/openfabmap.hpp:141:10: error: ‘void cv::of2::FabMap::compare(int)’ cannot be overloaded
     void compare(const vector<Mat>& queryImgDescriptors,
          ^
/usr/include/opencv2/contrib/openfabmap.hpp:138:10: error: with ‘void cv::of2::FabMap::compare(int)’
     void compare(const vector<Mat>& queryImgDescriptors, vector<
          ^
/usr/include/opencv2/contrib/openfabmap.hpp:148:35: error: ‘vector’ does not name a type
             int queryIndex, const vector<Mat>& testImgDescriptors,
                                   ^
/usr/include/opencv2/contrib/openfabmap.hpp:148:41: error: expected ‘,’ or ‘...’ before ‘<’ token
             int queryIndex, const vector<Mat>& testImgDescriptors,
                                         ^
/usr/include/opencv2/contrib/openfabmap.hpp:156:19: error: ‘vector’ does not name a type
             const vector<Mat>& testImgDescriptors,
                   ^
/usr/include/opencv2/contrib/openfabmap.hpp:156:25: error: expected ‘,’ or ‘...’ before ‘<’ token
             const vector<Mat>& testImgDescriptors,
                         ^
/usr/include/opencv2/contrib/openfabmap.hpp:161:32: error: ‘vector’ has not been declared
     void normaliseDistribution(vector<IMatch>& matches);
                                ^
/usr/include/opencv2/contrib/openfabmap.hpp:161:38: error: expected ‘,’ or ‘...’ before ‘<’ token
     void normaliseDistribution(vector<IMatch>& matches);
                                      ^
/usr/include/opencv2/contrib/openfabmap.hpp:177:5: error: ‘vector’ does not name a type
     vector<Mat> trainingImgDescriptors;
     ^
/usr/include/opencv2/contrib/openfabmap.hpp:178:5: error: ‘vector’ does not name a type
     vector<Mat> testImgDescriptors;
     ^
/usr/include/opencv2/contrib/openfabmap.hpp:179:5: error: ‘vector’ does not name a type
     vector<IMatch> priorMatches;
     ^
/usr/include/opencv2/contrib/openfabmap.hpp:206:62: error: ‘vector’ does not name a type
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                              ^
/usr/include/opencv2/contrib/openfabmap.hpp:206:68: error: expected ‘,’ or ‘...’ before ‘<’ token
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                                    ^
/usr/include/opencv2/contrib/openfabmap.hpp:222:62: error: ‘vector’ does not name a type
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                              ^
/usr/include/opencv2/contrib/openfabmap.hpp:222:68: error: expected ‘,’ or ‘...’ before ‘<’ token
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                                    ^
/usr/include/opencv2/contrib/openfabmap.hpp:246:62: error: ‘vector’ does not name a type
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                              ^
/usr/include/opencv2/contrib/openfabmap.hpp:246:68: error: expected ‘,’ or ‘...’ before ‘<’ token
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                                    ^
/usr/include/opencv2/contrib/openfabmap.hpp:298:28: error: ‘vector’ does not name a type
     void addTraining(const vector<Mat>& queryImgDescriptors);
                            ^
/usr/include/opencv2/contrib/openfabmap.hpp:298:34: error: expected ‘,’ or ‘...’ before ‘<’ token
     void addTraining(const vector<Mat>& queryImgDescriptors);
                                  ^
/usr/include/opencv2/contrib/openfabmap.hpp:303:20: error: ‘vector’ does not name a type
     void add(const vector<Mat>& queryImgDescriptors);
                    ^
/usr/include/opencv2/contrib/openfabmap.hpp:303:26: error: expected ‘,’ or ‘...’ before ‘<’ token
     void add(const vector<Mat>& queryImgDescriptors);
                          ^
/usr/include/opencv2/contrib/openfabmap.hpp:308:62: error: ‘vector’ does not name a type
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                              ^
/usr/include/opencv2/contrib/openfabmap.hpp:308:68: error: expected ‘,’ or ‘...’ before ‘<’ token
     void getLikelihoods(const Mat& queryImgDescriptor, const vector<
                                                                    ^
/usr/include/opencv2/contrib/openfabmap.hpp:313:61: error: ‘vector’ has not been declared
     void getIndexLikelihoods(const Mat& queryImgDescriptor, vector<
                                                             ^
/usr/include/opencv2/contrib/openfabmap.hpp:313:67: error: expected ‘,’ or ‘...’ before ‘<’ token
     void getIndexLikelihoods(const Mat& queryImgDescriptor, vector<
                                                                   ^
/usr/include/opencv2/contrib/openfabmap.hpp:317:13: error: ‘vector’ has not been declared
             vector<double>& defaults,
             ^
/usr/include/opencv2/contrib/openfabmap.hpp:317:19: error: expected ‘,’ or ‘...’ before ‘<’ token
             vector<double>& defaults,
                   ^
/usr/include/opencv2/contrib/openfabmap.hpp:321:5: error: ‘vector’ does not name a type
     vector<double> d1, d2, d3, d4;
     ^
/usr/include/opencv2/contrib/openfabmap.hpp:322:5: error: ‘vector’ does not name a type
     vector<vector<int> > children;
     ^
/usr/include/opencv2/contrib/openfabmap.hpp:326:5: error: ‘vector’ does not name a type
     vector<double> trainingDefaults;
     ^
/usr/include/opencv2/contrib/openfabmap.hpp:327:14: error: ‘vector’ was not declared in this scope
     map<int, vector<int> > trainingInvertedMap;
              ^
/usr/include/opencv2/contrib/openfabmap.hpp:327:14: note: suggested alternative:
In file included from /usr/include/c++/5/vector:64:0,
                 from /usr/local/include/opencv2/core/types.hpp:53,
                 from /usr/local/include/opencv2/core.hpp:58,
                 from /usr/local/include/opencv2/core/core.hpp:48,
                 from src/caffe/cpm_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 /usr/include/opencv2/contrib/contrib.hpp:981:0,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/include/opencv2/contrib/openfabmap.hpp:327:24: error: template argument 2 is invalid
     map<int, vector<int> > trainingInvertedMap;
                        ^
/usr/include/opencv2/contrib/openfabmap.hpp:327:24: error: template argument 4 is invalid
/usr/include/opencv2/contrib/openfabmap.hpp:327:26: error: expected unqualified-id before ‘>’ token
     map<int, vector<int> > trainingInvertedMap;
                          ^
/usr/include/opencv2/contrib/openfabmap.hpp:329:5: error: ‘vector’ does not name a type
     vector<double> testDefaults;
     ^
/usr/include/opencv2/contrib/openfabmap.hpp:330:14: error: ‘vector’ was not declared in this scope
     map<int, vector<int> > testInvertedMap;
              ^
/usr/include/opencv2/contrib/openfabmap.hpp:330:14: note: suggested alternative:
In file included from /usr/include/c++/5/vector:64:0,
                 from /usr/local/include/opencv2/core/types.hpp:53,
                 from /usr/local/include/opencv2/core.hpp:58,
                 from /usr/local/include/opencv2/core/core.hpp:48,
                 from src/caffe/cpm_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 /usr/include/opencv2/contrib/contrib.hpp:981:0,
                 from src/caffe/cpm_data_transformer.cpp:4:
/usr/include/opencv2/contrib/openfabmap.hpp:330:24: error: template argument 2 is invalid
     map<int, vector<int> > testInvertedMap;
                        ^
/usr/include/opencv2/contrib/openfabmap.hpp:330:24: error: template argument 4 is invalid
/usr/include/opencv2/contrib/openfabmap.hpp:330:26: error: expected unqualified-id before ‘>’ token
     map<int, vector<int> > testInvertedMap;
                          ^
/usr/include/opencv2/contrib/openfabmap.hpp:345:20: error: ‘vector’ does not name a type
     void add(const vector<Mat>& imgDescriptors);
                    ^
/usr/include/opencv2/contrib/openfabmap.hpp:345:26: error: expected ‘,’ or ‘...’ before ‘<’ token
     void add(const vector<Mat>& imgDescriptors);
                          ^
/usr/include/opencv2/contrib/openfabmap.hpp:347:11: error: ‘vector’ does not name a type
     const vector<Mat>& getImgDescriptors() const;
           ^
/usr/include/opencv2/contrib/openfabmap.hpp:352:5: error: ‘vector’ does not name a type
     vector<Mat> imgDescriptors;
     ^
/usr/include/opencv2/contrib/openfabmap.hpp:378:5: error: ‘vector’ does not name a type
     vector<int> extractChildren(list<info> &remaining_edges, int q);
     ^
Makefile:572: recipe for target '.build_release/src/caffe/cpm_data_transformer.o' failed
make: *** [.build_release/src/caffe/cpm_data_transformer.o] Error 1

I can compile caffe correctly, and I think the key is caffe_train introduces the opencv_contrib module. Since src/caffe/cpm_data_transformer.cpp needs opencv_contrib module, I can't just forbid opencv_contrib in Makefile.config. How can I solve this compilations problem?thx

yaochx commented 7 years ago

I use opencv 3.1.0 This project does not use opencv_contrib module, you can remove the dependancy by this:

  1. delete opencv_contrib in Makefile LIBRARIES += opencv_core opencv_highgui opencv_imgproc (delete opencv_contrib)
  2. remove the inlucde header ./src/caffe/cpm_data_transformer.cpp

    include <opencv2/contrib/contrib.hpp>

wujiyoung commented 7 years ago

@un-knight I met the problem too, have you solved it ?

un-knight commented 7 years ago

@wujiyoung Yes, but not in a direct way. I recommend you to try @yaochx 's method. It seems to make sense.

gineshidalgo99 commented 7 years ago

Yes, the solution is to remove the contrib as @yaochx says or to compile OpenCV with the contrib module.