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

python: Set gpu device id before setting gpu mode #6499

Merged
merged 1 commit into from
Aug 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/tutorial/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ Use CPU:

Use GPU and specify its gpu_id:

caffe.set_mode_gpu();
caffe.set_device(gpu_id);
caffe.set_mode_gpu();

#### Create a network and access its layers and blobs

Expand Down
2 changes: 1 addition & 1 deletion python/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def show_time():


def solve(proto, snapshot, gpus, timing, uid, rank):
caffe.set_mode_gpu()
caffe.set_device(gpus[rank])
caffe.set_mode_gpu()
caffe.set_solver_count(len(gpus))
caffe.set_solver_rank(rank)
caffe.set_multiprocess(True)
Expand Down