uhdessai commited on
Commit
76be887
·
verified ·
1 Parent(s): 31f241b

Update gen_images.py

Browse files
Files changed (1) hide show
  1. gen_images.py +3 -1
gen_images.py CHANGED
@@ -19,6 +19,8 @@ import PIL.Image
19
  import torch
20
 
21
  import legacy
 
 
22
 
23
  #----------------------------------------------------------------------------
24
 
@@ -103,7 +105,7 @@ def generate_images(
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
 
 
19
  import torch
20
 
21
  import legacy
22
+ os.environ["CUDA_VISIBLE_DEVICES"] = "" # Disables CUDA completely
23
+
24
 
25
  #----------------------------------------------------------------------------
26
 
 
105
  """
106
 
107
  print('Loading networks from "%s"...' % network_pkl)
108
+ device = torch.device('cpu')
109
  with dnnlib.util.open_url(network_pkl) as f:
110
  G = legacy.load_network_pkl(f)['G_ema'].to(device) # type: ignore
111