问题
I am using a legacy set up of caffe which is running on CPU.
I switched one line of code from:
caffe.set_mode_cpu()
to:
caffe.set_mode_gpu()
but I get the error:
Cannot use GPU in CPU-only Caffe: check mode.
I checked the Makefile.config and the relevant setting was:
#CPU-only switch (uncomment to build without GPU support)
CPU_only := 1
I assume 1 is True so I changed to
CPU_only := 0
but it did not help.
Any clues?
回答1:
You need to change:
#CPU-only switch (uncomment to build without GPU support)
CPU_only := 1
to this:
#CPU-only switch (uncomment to build without GPU support)
#CPU_only := 1
and rebuild.
来源:https://stackoverflow.com/questions/40382361/cannot-use-gpu-in-cpu-only-caffe-check-mode