caffe-yolo-9000 icon indicating copy to clipboard operation
caffe-yolo-9000 copied to clipboard

Compile error

Open zouhongwei opened this issue 7 years ago • 6 comments

When I complie caffe, I get some error, the output information is list bellow! Can you help me?

####################################################################### In file included from /usr/include/c++/4.8/algorithm:62:0, from /home/zouhongwei/workspce/caffe-yolo-9000/include/caffe/blob.hpp:4, from /home/zouhongwei/workspce/caffe-yolo-9000/include/caffe/caffe.hpp:7, from /home/zouhongwei/workspce/caffe-yolo-9000/examples/yolo_9000_test/netforward.cpp:1: /usr/include/c++/4.8/bits/stl_algo.h: In instantiation of ‘_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _Ra ndomAccessIterator, const _Tp&) [with _RandomAccessIterator = yolo_v2::DATA*; _Tp = yolo_v2::DATA]’: /usr/include/c++/4.8/bits/stl_algo.h:2283:70: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIte rator, _RandomAccessIterator) [with _RandomAccessIterator = yolo_v2::DATA*]’ /usr/include/c++/4.8/bits/stl_algo.h:2315:54: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator , _Size) [with _RandomAccessIterator = yolo_v2::DATA*; _Size = long int]’ /usr/include/c++/4.8/bits/stl_algo.h:5461:36: required from ‘void std::sort(_RAIter, RAIter) [with RAIter = yolo_v2::DATA*]’ /home/zouhongwei/workspce/caffe-yolo-9000/examples/yolo_9000_test/yolo_v2_output.h:97:51: required from ‘std::vector<yolo_v2::DATA> yolo_v2::getResult(std::vector&, std::vector&, int, float, float) [with int OBJECT_NUM = 5; int SIDE = 13]’ /home/zouhongwei/workspce/caffe-yolo-9000/examples/yolo_9000_test/netforward.cpp:86:86: required from here /usr/include/c++/4.8/bits/stl_algo.h:2245:19: error: passing ‘const yolo_v2::DATA’ as ‘this’ argument of ‘bool yolo_v2::DATA::operator <(yolo_v2::DATA)’ discards qualifiers [-fpermissive] while (__pivot < *__last) ^ make[2]: *** [examples/CMakeFiles/netforward.dir/yolo_9000_test/netforward.cpp.o] Error 1 make[1]: *** [examples/CMakeFiles/netforward.dir/all] Error 2 make: *** [all] Error 2

######################################################################

zouhongwei avatar Oct 17 '17 12:10 zouhongwei

umm.. that is interesting can you change caffe-yolo-9000/examples/yolo_9000_test/yolo_v2_output.h:21

bool operator<(DATA data) to bool operator<(const DATA &data)

and try again?

karta0807913 avatar Oct 17 '17 13:10 karta0807913

I tried it, but it does not work!

zouhongwei avatar Oct 17 '17 14:10 zouhongwei

got the same error?

karta0807913 avatar Oct 17 '17 14:10 karta0807913

yes, the same error!

zouhongwei avatar Oct 18 '17 08:10 zouhongwei

On my ubuntu is ok use g++ g++ (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 i think you need to update your g++ to 5 or upper

myname:/usr/include/c++$ ls
4.9/  4.9.3/  5/  5.4.0/

karta0807913 avatar Oct 22 '17 10:10 karta0807913

I had same problem, but I solved by changing caffe-yolo-9000/examples/yolo_9000_test/yolo_v2_output.h:21

bool operator<(DATA data) to bool operator<(const DATA &data) const

I hope it will help you

TheNerd-alexis avatar Feb 27 '18 12:02 TheNerd-alexis