Skip to content

Commit

Permalink
use only 1 gpu if available
Browse files Browse the repository at this point in the history
  • Loading branch information
JiahuiYu committed Mar 8, 2018
1 parent 8747474 commit a203e0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@


if __name__ == "__main__":
ng.get_gpus(1)
args = parser.parse_args()

model = InpaintCAModel()
Expand All @@ -29,7 +30,7 @@
assert image.shape == mask.shape

h, w, _ = image.shape
grid = 4
grid = 8
image = image[:h//grid*grid, :w//grid*grid, :]
mask = mask[:h//grid*grid, :w//grid*grid, :]
print('Shape of image: {}'.format(image.shape))
Expand Down

2 comments on commit a203e0a

@dragonkao730
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe ng.get_gpus(1, False) ?

@JiahuiYu
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To have ideal speed, let's try to find a dedicated GPU. You can fork to modify though. :)

Please sign in to comment.