Spaces:
Sleeping
Sleeping
set device correctly
Browse files
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(
|
41 |
|
42 |
-
logits = model.classifier(final_activations[0]).to(
|
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 |
|