Skip to content

Commit

Permalink
Merge pull request #64 from ohtake/fix-gpu-selection
Browse files Browse the repository at this point in the history
Fix GPU selection
  • Loading branch information
dutran committed Jan 15, 2019
2 parents 54d9322 + fb80eba commit 9c49f45
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/extract_features.py
Expand Up @@ -167,10 +167,8 @@ def fetchActivations(model, outputs, num_iterations):
for counter in range(num_iterations):
workspace.RunNet(model.net.Proto().name)
num_devices = 1 # default for cpu
if num_gpus > 0:
num_devices = num_gpus

for g in range(num_devices):
for g in gpus if num_gpus > 0 else range(num_devices):
for output_name in outputs:
blob_name = 'gpu_{}/'.format(g) + output_name
activations = workspace.FetchBlob(blob_name)
Expand Down

0 comments on commit 9c49f45

Please sign in to comment.