yiwenguo / Dynamic-Network-Surgery

Caffe implementation for dynamic network surgery.
Other
186 stars 70 forks source link

Error: ‘SolverAction’ has not been declared #5

Closed ycxia closed 7 years ago

ycxia commented 7 years ago

Hello! Thanks for your work. Could you help me to fix the compile problem? When I make all, the error: In file included from src/caffe/util/signal_handler.cpp:7:0: ./include/caffe/util/signal_handler.h:12:17: error: ‘SolverAction’ has not been declared SignalHandler(SolverAction::Enum SIGINT_action, ^ ./include/caffe/util/signal_handler.h:12:36: error: expected ‘)’ before ‘SIGINT_action’ SignalHandler(SolverAction::Enum SIGINT_action, ^ ./include/caffe/util/signal_handler.h:15:3: error: ‘ActionCallback’ does not name a type ActionCallback GetActionFunction(); ^ ./include/caffe/util/signal_handler.h:17:3: error: ‘SolverAction’ does not name a type SolverAction::Enum CheckForSignals() const; ^ ./include/caffe/util/signal_handler.h:18:3: error: ‘SolverAction’ does not name a type SolverAction::Enum SIGINTaction; ^ ./include/caffe/util/signal_handler.h:19:3: error: ‘SolverAction’ does not name a type SolverAction::Enum SIGHUPaction; ^ src/caffe/util/signal_handler.cpp:88:29: error: expected constructor, destructor, or type conversion before ‘(’ token SignalHandler::SignalHandler(SolverAction::Enum SIGINT_action, ^ src/caffe/util/signal_handler.cpp:99:1: error: ‘SolverAction’ does not name a type SolverAction::Enum SignalHandler::CheckForSignals() const { ^ src/caffe/util/signal_handler.cpp:111:1: error: ‘ActionCallback’ does not name a type ActionCallback SignalHandler::GetActionFunction() { ^ make: *** [.build_release/src/caffe/util/signal_handler.o] Error 1

The caffe version is classic. Thank you!

yiwenguo commented 7 years ago

Hi @ycxia. It is actually not really necessary to merge this repository with the whole classic Caffe package. Regarding to your problem, you'd better keep Caffe's solver.hpp file as it is and do not let it be overwritten.

ycxia commented 7 years ago

@yiwenguo Thanks for the reply. This time I am not merge this repository with classic Caffe, but I am not able to get past make test. I am getting the following error while running "make test". .build_release/src/caffe/test/test_neuron_layer.o:(.data.rel.ro._ZTVN5caffe8LogLayerIdEE[_ZTVN5caffe8LogLayerIdEE]+0x20): undefined reference to caffe::LogLayer<double>::LayerSetUp(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&)' .build_release/src/caffe/test/test_neuron_layer.o:(.data.rel.ro._ZTVN5caffe8LogLayerIdEE[_ZTVN5caffe8LogLayerIdEE]+0x90): undefined reference tocaffe::LogLayer::Forward_cpu(std::vector<caffe::Blob, std::allocator<caffe::Blob> > const&, std::vector<caffe::Blob, std::allocator<caffe::Blob> > const&)' .build_release/src/caffe/test/test_neuron_layer.o:(.data.rel.ro._ZTVN5caffe8LogLayerIdEE[_ZTVN5caffe8LogLayerIdEE]+0x98): undefined reference to caffe::LogLayer<double>::Forward_gpu(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&)' .build_release/src/caffe/test/test_neuron_layer.o:(.data.rel.ro._ZTVN5caffe8LogLayerIdEE[_ZTVN5caffe8LogLayerIdEE]+0xa0): undefined reference tocaffe::LogLayer::Backward_cpu(std::vector<caffe::Blob, std::allocator<caffe::Blob> > const&, std::vector<bool, std::allocator > const&, std::vector<caffe::Blob, std::allocator<caffe::Blob> > const&)' .build_release/src/caffe/test/test_neuron_layer.o:(.data.rel.ro._ZTVN5caffe8LogLayerIdEE[_ZTVN5caffe8LogLayerIdEE]+0xa8): undefined reference to caffe::LogLayer<double>::Backward_gpu(std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&, std::vector<bool, std::allocator<bool> > const&, std::vector<caffe::Blob<double>*, std::allocator<caffe::Blob<double>*> > const&)' .build_release/src/caffe/test/test_neuron_layer.o:(.data.rel.ro._ZTVN5caffe8LogLayerIfEE[_ZTVN5caffe8LogLayerIfEE]+0x20): undefined reference tocaffe::LogLayer::LayerSetUp(std::vector<caffe::Blob, std::allocator<caffe::Blob> > const&, std::vector<caffe::Blob, std::allocator<caffe::Blob> > const&)' .build_release/src/caffe/test/test_neuron_layer.o:(.data.rel.ro._ZTVN5caffe8LogLayerIfEE[_ZTVN5caffe8LogLayerIfEE]+0x90): undefined reference to caffe::LogLayer<float>::Forward_cpu(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&)' .build_release/src/caffe/test/test_neuron_layer.o:(.data.rel.ro._ZTVN5caffe8LogLayerIfEE[_ZTVN5caffe8LogLayerIfEE]+0x98): undefined reference tocaffe::LogLayer::Forward_gpu(std::vector<caffe::Blob, std::allocator<caffe::Blob> > const&, std::vector<caffe::Blob, std::allocator<caffe::Blob> > const&)' .build_release/src/caffe/test/test_neuron_layer.o:(.data.rel.ro._ZTVN5caffe8LogLayerIfEE[_ZTVN5caffe8LogLayerIfEE]+0xa0): undefined reference to caffe::LogLayer<float>::Backward_cpu(std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&, std::vector<bool, std::allocator<bool> > const&, std::vector<caffe::Blob<float>*, std::allocator<caffe::Blob<float>*> > const&)' .build_release/src/caffe/test/test_neuron_layer.o:(.data.rel.ro._ZTVN5caffe8LogLayerIfEE[_ZTVN5caffe8LogLayerIfEE]+0xa8): undefined reference tocaffe::LogLayer::Backward_gpu(std::vector<caffe::Blob, std::allocator<caffe::Blob> > const&, std::vector<bool, std::allocator > const&, std::vector<caffe::Blob, std::allocator<caffe::Blob> > const&)' collect2: error: ld returned 1 exit status make: *** [.build_release/test/test_all.testbin] Error 1

"Make all" works without any trouble. Any help would be appreciated.

I am compiling this on Ubuntu 14.04 without cudnn and to be exact on the NVIDIA's DevBox. Thanks.

yiwenguo commented 7 years ago

Hi @ycxia , we didn't write test for the compression layers in this repo, so better not to make test or make runtest for them.

chiukeung commented 6 years ago

@ycxia Hi I got the same error when running 'make test'. Did you solve the problem? THX

ycxia commented 6 years ago

@chiukeung author didn't write test for the compression layers in this repo, so better not to make test or make runtest for them.

chiukeung commented 6 years ago

@ycxia Thanks a lot. I found there's no code in the file of log_layer.cpp and log_layer.cu. I don't know why this happened. So I change these two files with full edition from other place.