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
Set mode cpu fails? #3317
Comments
OK. This is related to the CUDNN flag (which I set to 1) |
You can specify explicitly in the conv layer param definitions to use the non-cudnn layer version: Alternatively, you can change the caffe code: GetConvolutionLayer() to select ConvolutionParameter_Engine_CUDNN only if "Caffe::mode() == Caffe::GPU" |
I encountered a similar issue, I was using Caffe in CPU mode with a GPU available that did not have sufficient memory available. This resulted in errors like The layer factory should not attempt to use the cuDNN engine in CPU only situations. So: If the engine is set to default, only consider the cuDNN engine in GPU mode. |
The problem here is that the LayerSetup for CuDNN does GPU things and does not respect the mode flag. Some fixes:
Considering my proposal in 4, I'm inclinded to create a PR for option 1 as a quick fix now and ignore that the CuDNN layers don't support switching to CPU mode. |
hear hear, i've hit this error as well and it is rather unexpected and confusing to get gpu errors seeing as how I set mode cpu . the issue is closed but the (imho bad) behavior persists |
Why is the PR closed? this looks like a legit bug. CPU mode should not try to use CUDNN if it caffe is compiled |
@dashesy The PR that was closed was a fix that was applied to a fork of BVLC's code. Nothing has been updated on the BVLC master. |
…led wiht USE_CUDNN Fixes BVLC#3317
Any tutorial to switch to CPU-only caffe? |
Hi,
Installed Caffe Yesterday. Everything works fine if I run things on a machine with gpu.
However, when I try to run things on a machine without gpu, I get the following error:
import caffe
caffe.set_mode_cpu()
WARNING: Logging before InitGoogleLogging() is written to STDERR
E1111 11:05:00.244045 15828 common.cpp:104] Cannot create Cublas handle. Cublas won't be available.
E1111 11:05:00.250761 15828 common.cpp:111] Cannot create Curand generator. Curand won't be available.
Then, when trying to load the reference model, python crashes:
net = caffe.Net(proto_file, model_file, caffe.TEST)
I1111 11:04:24.878739 10921 net.cpp:49] Initializing net from parameters:
....
I1111 11:04:24.879976 10921 net.cpp:106] Creating Layer conv1
I1111 11:04:24.879987 10921 net.cpp:454] conv1 <- data
I1111 11:04:24.880014 10921 net.cpp:411] conv1 -> conv1
F1111 11:04:28.563159 10921 cudnn_conv_layer.cpp:52] Check failed: error == cudaSuccess (38 vs. 0) no CUDA-capable device is detected
*** Check failure stack trace: ***
Aborted
The text was updated successfully, but these errors were encountered: