Skip to content

Instantly share code, notes, and snippets.

@ucalyptus2
Created August 8, 2020 19:25
Show Gist options
  • Save ucalyptus2/dbf7be4b8531abba84639b02c8d9d433 to your computer and use it in GitHub Desktop.
Save ucalyptus2/dbf7be4b8531abba84639b02c8d9d433 to your computer and use it in GitHub Desktop.
#NOTE: This must be the first call in order to work properly!
from deoldify import device
from deoldify.device_id import DeviceId
#choices: CPU, GPU0...GPU7
device.set(device=DeviceId.GPU0)
import torch
if not torch.cuda.is_available():
print('GPU not available.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment