uhdessai commited on
Commit
31f241b
·
verified ·
1 Parent(s): 36ac0c4

Update gen_images.py

Browse files
Files changed (1) hide show
  1. gen_images.py +1 -1
gen_images.py CHANGED
@@ -103,7 +103,7 @@ def generate_images(
103
  """
104
 
105
  print('Loading networks from "%s"...' % network_pkl)
106
- device = torch.device('cuda')
107
  with dnnlib.util.open_url(network_pkl) as f:
108
  G = legacy.load_network_pkl(f)['G_ema'].to(device) # type: ignore
109
 
 
103
  """
104
 
105
  print('Loading networks from "%s"...' % network_pkl)
106
+ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
107
  with dnnlib.util.open_url(network_pkl) as f:
108
  G = legacy.load_network_pkl(f)['G_ema'].to(device) # type: ignore
109