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

Compiling error with suggested version of Caffe

Open farshidfarhat opened this issue 8 years ago • 6 comments

I set Makefile.config for CPU_ONLY := 1

CXX src/caffe/data_transformer.cpp src/caffe/data_transformer.cpp: In member function ‘void caffe::DataTransformer<Dtype>::clahe(cv::Mat&, int, int)’: src/caffe/data_transformer.cpp:1375:7: error: ‘CLAHE’ was not declared in this scope src/caffe/data_transformer.cpp:1375:12: error: template argument 1 is invalid src/caffe/data_transformer.cpp:1375:20: error: invalid type in declaration before ‘=’ token src/caffe/data_transformer.cpp:1375:69: error: there are no arguments to ‘createCLAHE’ that depend on a template parameter, so a declaration of ‘createCLAHE’ must be available [-fpermissive] src/caffe/data_transformer.cpp:1375:69: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated) src/caffe/data_transformer.cpp:1378:8: error: base operand of ‘->’ is not a pointer src/caffe/data_transformer.cpp: In instantiation of ‘void caffe::DataTransformer<Dtype>::ReadMetaData(caffe::DataTransformer<Dtype>::MetaData&, const string&, size_t, size_t) [with Dtype = float; std::string = std::basic_string; size_t = long unsigned int]’: src/caffe/data_transformer.cpp:1416:1: required from here src/caffe/data_transformer.cpp:70:1: error: cannot bind ‘std::basic_ostream’ lvalue to ‘std::basic_ostream&&’ In file included from /gpfs/apps/x86_64-rhel6/gcc/4.7.1/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/istream:41:0, from /gpfs/apps/x86_64-rhel6/gcc/4.7.1/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/sstream:39, from /gpfs/apps/x86_64-rhel6/gcc/4.7.1/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/complex:47, from /usr/global/opencv/2.4.2/include/opencv2/core/core.hpp:59, from src/caffe/data_transformer.cpp:2: /gpfs/apps/x86_64-rhel6/gcc/4.7.1/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/ostream:600:5: error: initializing argument 1 of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits; Tp = cv::Size]’ src/caffe/data_transformer.cpp: In instantiation of ‘void caffe::DataTransformer<Dtype>::clahe(cv::Mat&, int, int) [with Dtype = float]’: src/caffe/data_transformer.cpp:1416:1: required from here src/caffe/data_transformer.cpp:1375:69: error: ‘createCLAHE’ was not declared in this scope src/caffe/data_transformer.cpp: In instantiation of ‘void caffe::DataTransformer<Dtype>::ReadMetaData(caffe::DataTransformer<Dtype>::MetaData&, const string&, size_t, size_t) [with Dtype = double; std::string = std::basic_string; size_t = long unsigned int]’: src/caffe/data_transformer.cpp:1416:1: required from here src/caffe/data_transformer.cpp:70:1: error: cannot bind ‘std::basic_ostream’ lvalue to ‘std::basic_ostream&&’ In file included from /gpfs/apps/x86_64-rhel6/gcc/4.7.1/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/istream:41:0, from /gpfs/apps/x86_64-rhel6/gcc/4.7.1/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/sstream:39, from /gpfs/apps/x86_64-rhel6/gcc/4.7.1/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/complex:47, from /usr/global/opencv/2.4.2/include/opencv2/core/core.hpp:59, from src/caffe/data_transformer.cpp:2: /gpfs/apps/x86_64-rhel6/gcc/4.7.1/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.7.1/../../../../include/c++/4.7.1/ostream:600:5: error: initializing argument 1 of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits; Tp = cv::Size]’ src/caffe/data_transformer.cpp: In instantiation of ‘void caffe::DataTransformer<Dtype>::clahe(cv::Mat&, int, int) [with Dtype = double]’: src/caffe/data_transformer.cpp:1416:1: required from here src/caffe/data_transformer.cpp:1375:69: error: ‘createCLAHE’ was not declared in this scope In file included from /gpfs/home/fuf111/usr/include/boost/filesystem/path_traits.hpp:23:0, from /gpfs/home/fuf111/usr/include/boost/filesystem/path.hpp:25, from /gpfs/home/fuf111/usr/include/boost/filesystem.hpp:16, from ./include/caffe/util/io.hpp:4, from src/caffe/data_transformer.cpp:19: /gpfs/home/fuf111/usr/include/boost/system/error_code.hpp: At global scope: /gpfs/home/fuf111/usr/include/boost/system/error_code.hpp:221:36: warning: ‘boost::system::posix_category’ defined but not used [-Wunused-variable] /gpfs/home/fuf111/usr/include/boost/system/error_code.hpp:222:36: warning: ‘boost::system::errno_ecat’ defined but not used [-Wunused-variable] /gpfs/home/fuf111/usr/include/boost/system/error_code.hpp:223:36: warning: ‘boost::system::native_ecat’ defined but not used [-Wunused-variable] make: *** [.build_release/src/caffe/data_transformer.o] Error 1

farshidfarhat avatar Oct 24 '16 03:10 farshidfarhat

Even I am getting an error when I try to compile with CPU_ONLY := 1, but its a different error from the above.

Error

CXX src/caffe/layers/euclidean2_loss_layer.cpp In file included from ./include/caffe/common.hpp:19:0, from ./include/caffe/blob.hpp:8, from ./include/caffe/loss_layers.hpp:8, from src/caffe/layers/euclidean2_loss_layer.cpp:3: ./include/caffe/util/device_alternate.hpp:15:36: error: no ‘void caffe::Euclidean2LossLayer<Dtype>::Forward_gpu(const std::vectorcaffe::Blob<Dtype_>&, const std::vectorcaffe::Blob<Dtype_>&)’ member function declared in class ‘caffe::Euclidean2LossLayer<Dtype>’ const vector<Blob<Dtype>>& top) { NO_GPU; }
^ src/caffe/layers/euclidean2_loss_layer.cpp:112:1: note: in expansion of macro ‘STUB_GPU’ STUB_GPU(Euclidean2LossLayer); ^ ./include/caffe/util/device_alternate.hpp:19:39: error: no ‘void caffe::Euclidean2LossLayer<Dtype>::Backward_gpu(const std::vectorcaffe::Blob<Dtype
>&, const std::vector&, const std::vectorcaffe::Blob<Dtype_>&)’ member function declared in class ‘caffe::Euclidean2LossLayer<Dtype>’ const vector<Blob<Dtype>_>& bottom) { NO_GPU; }
^ src/caffe/layers/euclidean2_loss_layer.cpp:112:1: note: in expansion of macro ‘STUB_GPU’ STUB_GPU(Euclidean2LossLayer); ^ Makefile:552: recipe for target '.build_release/src/caffe/layers/euclidean2_loss_layer.o' failed make: *** [.build_release/src/caffe/layers/euclidean2_loss_layer.o] Error 1

Any help would be appreciated. @shihenw @Geekking

spagad7 avatar Oct 26 '16 17:10 spagad7

Hi , @farshid83 @sptg I encountered the same problem too. Finally, i understand that we must compile the version of Caffe with gpu support, but when you run CPM_demo.m ,you can select use cpu mode to test by edit testing/config.m line 6 param.use_gpu =0.

https://github.com/shihenw/convolutional-pose-machines-release/blob/master/testing/config.m#L4-6

mindcont avatar Dec 09 '16 00:12 mindcont

In the updated caffe repo I can successfully compile with CPU_ONLY := 1. Please report again if same error still happens, thanks.

shihenw avatar Dec 21 '16 22:12 shihenw

Hello, I'm using ubuntu 14.04 trying to compile caffe. I ran into this error while I was doing runtest: [ RUN ] NetUpgradeTest.TestUpgradeV1LayerType F0104 22:48:50.839651 15288 upgrade_proto.cpp:957] Unknown V1LayerParameter layer type: 40 *** Check failure stack trace: *** @ 0x2b7615bd1daa (unknown) @ 0x2b7615bd1ce4 (unknown) @ 0x2b7615bd16e6 (unknown) @ 0x2b7615bd4687 (unknown) @ 0x2b7617cc00e8 caffe::UpgradeV1LayerType() @ 0x4f6f32 caffe::NetUpgradeTest_TestUpgradeV1LayerType_Test::TestBody() @ 0x6fceb3 testing::internal::HandleExceptionsInMethodIfSupported<>() @ 0x6f3b37 testing::Test::Run() @ 0x6f3bde testing::TestInfo::Run() @ 0x6f3ce5 testing::TestCase::Run() @ 0x6f7028 testing::internal::UnitTestImpl::RunAllTests() @ 0x6f72b7 testing::UnitTest::Run() @ 0x45a292 main @ 0x2b76186d8f45 (unknown) @ 0x4614e9 (unknown) @ (nil) (unknown) Aborted (core dumped) make: *** [runtest] Error 134

I am using CPU only, my questions are does it have to work with GPU? Is CUDNN necessary? Do I need to install CUDA if I am only using CPU?

Thank you

pidog1993 avatar Jan 05 '17 03:01 pidog1993

Hi, when I was compiling your caffe, I got the following problem when I do "make runtest", any ideas how to solve this?

[ RUN ] LayerFactoryTest/0.TestCreateLayer F0327 13:26:21.745893 11280 db_leveldb.cpp:16] Check failed: status.ok() Failed to open leveldb IO error: /LOCK: Permission denied *** Check failure stack trace: *** @ 0x2b0e66dbfdaa (unknown) @ 0x2b0e66dbfce4 (unknown) @ 0x2b0e66dbf6e6 (unknown) @ 0x2b0e66dc2687 (unknown) @ 0x2b0e660a017a caffe::db::LevelDB::Open() @ 0x2b0e660beaee caffe::DataReader::Body::InternalThreadEntry() @ 0x2b0e660a095f caffe::InternalThread::entry() @ 0x2b0e66770a4a (unknown) @ 0x2b0e66b99184 start_thread @ 0x2b0e6cfb1bed (unknown) @ (nil) (unknown) Aborted (core dumped)

ShanxinYuan avatar Mar 27 '17 14:03 ShanxinYuan

it seems you need to run the demo with use_cuda

WeihongM avatar Dec 07 '17 10:12 WeihongM