Closed aPonza closed 5 years ago
By adding some #ifdef
guards to the .cu file I managed to get the code to compile (the small patch can be found in the issue referenced right up here) but I'm now facing a linker error, which doesn't really seem to stem from the modification made with the addition of the upsample layer, but I'll double check tomorrow.
For completeness, here's the linker error:
~/code/clCaffe/build$ make -j8
[ 1%] Built target proto
[ 1%] Built target pretune_convert
[ 80%] Built target caffe
[ 80%] Linking CXX executable caffe
[ 80%] Linking CXX executable get_image_size
[ 80%] Linking CXX executable upgrade_solver_proto_text
[ 81%] Linking CXX executable convert_annoset
[ 82%] Built target device_query
[ 82%] Built target train_net
[ 84%] Built target test_net
[ 85%] Built target net_speed_benchmark
[ 86%] Linking CXX executable convert_imageset
[ 86%] Linking CXX executable upgrade_net_proto_binary
[ 86%] Linking CXX executable compute_image_mean
[ 86%] Linking CXX executable caffe-fp16.bin
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/get_image_size.dir/build.make:128: recipe for target 'tools/get_image_size' failed
make[2]: *** [tools/get_image_size] Error 1
CMakeFiles/Makefile2:697: recipe for target 'tools/CMakeFiles/get_image_size.dir/all' failed
make[1]: *** [tools/CMakeFiles/get_image_size.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/convert_annoset.dir/build.make:128: recipe for target 'tools/convert_annoset' failed
make[2]: *** [tools/convert_annoset] Error 1
CMakeFiles/Makefile2:773: recipe for target 'tools/CMakeFiles/convert_annoset.dir/all' failed
make[1]: *** [tools/CMakeFiles/convert_annoset.dir/all] Error 2
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/upgrade_net_proto_binary.dir/build.make:128: recipe for target 'tools/upgrade_net_proto_binary' failed
make[2]: *** [tools/upgrade_net_proto_binary] Error 1
CMakeFiles/Makefile2:811: recipe for target 'tools/CMakeFiles/upgrade_net_proto_binary.dir/all' failed
make[1]: *** [tools/CMakeFiles/upgrade_net_proto_binary.dir/all] Error 2
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/caffe.bin.dir/build.make:128: recipe for target 'tools/caffe' failed
make[2]: *** [tools/caffe] Error 1
CMakeFiles/Makefile2:621: recipe for target 'tools/CMakeFiles/caffe.bin.dir/all' failed
make[1]: *** [tools/CMakeFiles/caffe.bin.dir/all] Error 2
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/upgrade_solver_proto_text.dir/build.make:128: recipe for target 'tools/upgrade_solver_proto_text' failed
make[2]: *** [tools/upgrade_solver_proto_text] Error 1
CMakeFiles/Makefile2:507: recipe for target 'tools/CMakeFiles/upgrade_solver_proto_text.dir/all' failed
make[1]: *** [tools/CMakeFiles/upgrade_solver_proto_text.dir/all] Error 2
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/compute_image_mean.dir/build.make:128: recipe for target 'tools/compute_image_mean' failed
make[2]: *** [tools/compute_image_mean] Error 1
CMakeFiles/Makefile2:925: recipe for target 'tools/CMakeFiles/compute_image_mean.dir/all' failed
make[1]: *** [tools/CMakeFiles/compute_image_mean.dir/all] Error 2
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/convert_imageset.dir/build.make:128: recipe for target 'tools/convert_imageset' failed
make[2]: *** [tools/convert_imageset] Error 1
CMakeFiles/Makefile2:849: recipe for target 'tools/CMakeFiles/convert_imageset.dir/all' failed
make[1]: *** [tools/CMakeFiles/convert_imageset.dir/all] Error 2
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform[abi:cxx11](char const*, char const*) const'
../lib/libcaffe.so.1.0.0-rc5: undefined reference to `boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const'
collect2: error: ld returned 1 exit status
tools/CMakeFiles/caffe-fp16.bin.dir/build.make:128: recipe for target 'tools/caffe-fp16.bin' failed
make[2]: *** [tools/caffe-fp16.bin] Error 1
CMakeFiles/Makefile2:887: recipe for target 'tools/CMakeFiles/caffe-fp16.bin.dir/all' failed
make[1]: *** [tools/CMakeFiles/caffe-fp16.bin.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
Didn't think about it yesterday but this is due to me having switched back to gcc-7. Compiling with gcc-5 solves the linker problem.
I'll have to look into the greentea counterpart of the cuda code, but apart from that this issue can probably be closed.
I have this compilation error while recompiling caffe after installing the upsample layer. It's seemingly due to me not having CUDA installed, so I'll try to do that now, since:
upsample_layer.cu
file;caffe_gpu_set
is included in file "caffe/util/math_functions.hpp" but only available if these guards are passed:and I'm defining USE_CUDA=OFF at the CMake level (instructions taken from here).
Could somebody help me with this? Would it be possible to keep the upsample layer in CPU mode? Is it mandatory to keep it to convert YOLOv3 to caffemodel?
The full log from compilation is this one, just in case some context is needed: