SoggyKiwi commited on
Commit
fa12e38
1 Parent(s): 3c13f2b

set device correctly

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -37,9 +37,9 @@ def process_image(input_image, learning_rate, iterations, n_targets, seed):
37
  if pixel_values.grad is not None:
38
  pixel_values.grad.data.zero_()
39
 
40
- final_activations = get_encoder_activations(pixel_values.to('cuda'))
41
 
42
- logits = model.classifier(final_activations[0]).to(pixel_values.device)
43
 
44
  original_loss = BCEWithLogitsLoss(reduction='sum')(logits,random_one_logits)
45
 
 
37
  if pixel_values.grad is not None:
38
  pixel_values.grad.data.zero_()
39
 
40
+ final_activations = get_encoder_activations(pixel_values.to(device))
41
 
42
+ logits = model.classifier(final_activations[0]).to(device)
43
 
44
  original_loss = BCEWithLogitsLoss(reduction='sum')(logits,random_one_logits)
45