weiliu89 / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
4.77k stars 1.68k forks source link

Problems when compiling #214

Open GDUTCPSDL opened 8 years ago

GDUTCPSDL commented 8 years ago

Env: Ubuntu14.04, CUDA 8.0, opencv-2.4.13, gcc-4.8.4, atlas

/usr/include/boost/property_tree/detail/json_parser_read.hpp: In constructor ‘boost::property_tree::json_parser::json_grammar<Ptree>::definition<Scanner>::definition(const boost::property_tree::json_parser::json_grammar<Ptree>&)’:
/usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array
                 escape
                                                                                                                                                                                                                                                                        ^
/usr/include/boost/property_tree/detail/json_parser_read.hpp:257:264: error: ‘type name’ declared as function returning an array
CMake Error at cuda_compile_generated_detection_output_layer.cu.o.cmake:264 (message):
  Error generating file
  /root/caffe-ssd/build/src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_detection_output_layer.cu.o

make[2]: *** [src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_detection_output_layer.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
make: *** [all] Error 2

And I had a look at the file /usr/include/boost/property_tree/detail/json_parser_read.hpp:

257                 escape
258                     =   chset_p(detail::widen<Ch>("\"\\/bfnrt").c_str())
259                             [typename Context::a_escape(self.c)]
260                     |   'u' >> uint_parser<unsigned long, 16, 4, 4>()
261                             [typename Context::a_unicode(self.c)]
262                     ;
263 
264                 // Debug

What's wrong? I couldn't find anything about it on google.

GDUTCPSDL commented 8 years ago

Why does it have something to do with boost??

GDUTCPSDL commented 8 years ago

@weiliu89 Plz help us. We had complied faster-rcnn, but all ok.. Why we can't compile ssd??

weiliu89 commented 8 years ago

Because everything is written in C++ in SSD.

The bug is related to CUDA and g++. You could either switch to cuda 7.5 or upgrade g++ to 5.4

GDUTCPSDL commented 8 years ago

We can only use CUDA 8.0 cuz we use GTX1080. And nothing changed when we upgrade g++ to 5.4. What's the version of boost required? Error msg changed after we upgraded boost to 1.62. @weiliu89 Thx.

weiliu89 commented 8 years ago

Could you try to make clean and rebuild everything?

revilokeb commented 7 years ago

When installing caffe branch ssd on an nvidia-docker image (nvidia/cuda:8.0-cudnn5-devel) I observed a similar error while running make -j8:

/usr/include/boost/property_tree/detail/json_parser_read.hpp:257-264: error: 'type name' declared as function returning an array

This however is solved by upgrading g++ and gcc to 5.4 as suggested above (e.g. as in http://askubuntu.com/questions/26498/choose-gcc-and-g-version after installing more recent version as e.g. in http://askubuntu.com/questions/618474/how-to-install-the-latest-gcurrently-5-1-in-ubuntucurrently-14-04)