-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Python can't set the device / phase for net initialization #1700
Comments
shelhamer
changed the title
Python can't set the device for cuDNN layers
Python can't set the device / phase for net initialization
Jan 15, 2015
shelhamer
added a commit
to shelhamer/caffe
that referenced
this issue
Jan 15, 2015
Attach mode, phase, and device setters to caffe module itself so that these can be set before making nets. This is needed to properly initialize layers with the right device and phase configuration.
shelhamer
added a commit
to shelhamer/caffe
that referenced
this issue
Jan 15, 2015
Attach mode, phase, and device setters to caffe module itself so that these can be set before making nets. This is needed to properly initialize layers with the right device and phase configuration.
shelhamer
added a commit
to shelhamer/caffe
that referenced
this issue
Jan 15, 2015
Attach mode, phase, and device setters to caffe module itself so that these can be set before making nets. This is needed to properly initialize layers with the right device and phase configuration. Update examples to new usage.
shelhamer
added a commit
to shelhamer/caffe
that referenced
this issue
Jan 15, 2015
Attach mode, phase, and device setters to caffe module itself so that these can be set before making nets. This is needed to properly initialize layers with the right device and phase configuration. Update examples to new usage.
shelhamer
added a commit
to shelhamer/caffe
that referenced
this issue
Jan 15, 2015
Attach mode, phase, and device setters to caffe module itself so that these can be set before making nets. This is needed to properly initialize layers with the right device and phase configuration. Update examples to new usage.
shelhamer
added a commit
that referenced
this issue
Jan 28, 2015
Attach mode, phase, and device setters to caffe module itself so that these can be set before making nets. This is needed to properly initialize layers with the right device and phase configuration. Update examples to new usage.
How do I make this modification for DIGITS? I am getting that same error there after the first epoch. |
@alfredox10, can you open a new issue against DIGITS? I bet your issue is unrelated to this one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cuDNN handles and such are acquired at net initialization when the cuDNN layers that require these resources are constructed. Since the Python interface only exposes
set_device()
as a method ofNet
instead of a module function, it is too late to actually set the device for cuDNN computation once the net is made. All cuDNN computation from Python is run on GPU 0 for this reason, and attempts to set other devices will fail withdue to the disagreement between initialization and execution.
@longjon has the workaround for now: use the environment variable CUDA_VISIBLE_DEVICES instead of using set_device.
The simplest fix is to expose
set_device()
andset_phase
from thecaffe
module itself as functions. This is only a bandaid and changes the interface.Of course The Right Idea is to make Net responsible for device and phase, set them at initialization, and never switch #1500... but that involves a few details.
The text was updated successfully, but these errors were encountered: