Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I run caffe-yolo on non-GPU machine? #19

Open
mohanadkaleia opened this issue Apr 11, 2017 · 6 comments
Open

Can I run caffe-yolo on non-GPU machine? #19

mohanadkaleia opened this issue Apr 11, 2017 · 6 comments

Comments

@mohanadkaleia
Copy link

Hello, I'm trying to test YOLO model on Caffe on my local machine which I don't have GPU,
Can I run YOLO using CPU-machine?
Thank you

@Harick1
Copy link
Owner

Harick1 commented Apr 11, 2017

Sure you can. If you use my python script to test, just set "caffe.set_mode_cpu()" in the script when testing on a CPU-machine.

@mohanadkaleia
Copy link
Author

When I try to run:
make -j8
it gives me the following error:

In file included from ./include/caffe/common.hpp:19:0, from ./include/caffe/blob.hpp:8, from ./include/caffe/layers/detection_loss_layer.hpp:6, from src/caffe/layers/detection_loss_layer.cpp:6: ./include/caffe/util/device_alternate.hpp:15:36: error: no ‘void caffe::DetectionLossLayer<Dtype>::Forward_gpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<caffe::Blob<Dtype>*>&)’ member function declared in class ‘caffe::DetectionLossLayer<Dtype>’ const vector<Blob<Dtype>*>& top) { NO_GPU; } \ ^ src/caffe/layers/detection_loss_layer.cpp:222:1: note: in expansion of macro ‘STUB_GPU’ STUB_GPU(DetectionLossLayer); ^ ./include/caffe/util/device_alternate.hpp:19:39: error: no ‘void caffe::DetectionLossLayer<Dtype>::Backward_gpu(const std::vector<caffe::Blob<Dtype>*>&, const std::vector<bool>&, const std::vector<caffe::Blob<Dtype>*>&)’ member function declared in class ‘caffe::DetectionLossLayer<Dtype>’ const vector<Blob<Dtype>*>& bottom) { NO_GPU; } \ ^ src/caffe/layers/detection_loss_layer.cpp:222:1: note: in expansion of macro ‘STUB_GPU’ STUB_GPU(DetectionLossLayer); ^ Makefile:572: recipe for target '.build_release/src/caffe/layers/detection_loss_layer.o' failed make: *** [.build_release/src/caffe/layers/detection_loss_layer.o] Error 1 make: *** Waiting for unfinished jobs....

@Harick1
Copy link
Owner

Harick1 commented Apr 12, 2017

Have you set CPU_ONLY := 1 in the Makefile.config?

@mohanadkaleia
Copy link
Author

mohanadkaleia commented Apr 12, 2017

Yes, I did

# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1

Do I need to set anything else?

@Harick1
Copy link
Owner

Harick1 commented Apr 12, 2017

You can try removing the following lines in the detection_loss_layer.cpp
#ifdef CPU_ONLY STUB_GPU(DetectionLossLayer); #endif

@mohanadkaleia
Copy link
Author

Great, it worked,
Thank you, appreciate it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants