Up-Down-Captioner icon indicating copy to clipboard operation
Up-Down-Captioner copied to clipboard

make -j8 error

Open natasasdj opened this issue 6 years ago • 2 comments

Makefile.config: CPU_ONLY := 1

I am trying to build with CPU only. I don't want to train the model but I wanted just to make an inference and to look in more details in the dimensions of different variables in the model. Is it possible to build your version of caffe with CPU_ONLY flag? I succeeded it with normal caffe.

Error obtained: src/caffe/layers/argmax_layer.cpp:99:29: error: macro "STUB_GPU_FORWARD" requires 2 arguments, but only 1 given STUB_GPU_FORWARD(ArgMaxLayer); ^ src/caffe/layers/argmax_layer.cpp:99:1: error: ‘STUB_GPU_FORWARD’ does not name a type STUB_GPU_FORWARD(ArgMaxLayer); ^ Makefile:581: recipe for target '.build_release/src/caffe/layers/argmax_layer.o' failed make: *** [.build_release/src/caffe/layers/argmax_layer.o] Error 1

natasasdj avatar Aug 24 '18 10:08 natasasdj

This is a bug you may encounter if you want to compile with CPU only flag on. The backward function for argmax layer was not implemented for CPU users, this is why the author use STUB_GPU_FORWARD to register the layer for CPU instead of STUB_GPU like other layers. However, the author may have forgotten to add necessary argument for the function. Go to argmax_layer.cpp and simply change STUB_GPU_FORWARD(ArgMaxLayer); to STUB_GPU_FORWARD(ArgMaxLayer,Forward); should solve the issue.

aBlueDragon avatar Sep 17 '18 07:09 aBlueDragon

STUB_GPU_FORWARD(ArgMaxLayer,Forward);

Thanks a lot and helps my issue.

yezhengli-Mr9 avatar Jan 07 '21 05:01 yezhengli-Mr9