Spaces:
Sleeping
Sleeping
Removing CUDA
Browse files
app.py
CHANGED
@@ -60,13 +60,13 @@ class Wrapper(torch.nn.Module):
|
|
60 |
|
61 |
def get_layer4(input_image):
|
62 |
l4_model = models.resnet50(pretrained=True)
|
63 |
-
l4_model = l4_model.cuda()
|
64 |
l4_model.eval();
|
65 |
wrapped_model = Wrapper(l4_model)
|
66 |
|
67 |
with torch.no_grad():
|
68 |
data = imagenet_transform(input_image).unsqueeze(0)
|
69 |
-
data = data.cuda()
|
70 |
reference_layer4 = wrapped_model(data)
|
71 |
|
72 |
return reference_layer4.data.to('cpu').numpy()
|
|
|
60 |
|
61 |
def get_layer4(input_image):
|
62 |
l4_model = models.resnet50(pretrained=True)
|
63 |
+
# l4_model = l4_model.cuda()
|
64 |
l4_model.eval();
|
65 |
wrapped_model = Wrapper(l4_model)
|
66 |
|
67 |
with torch.no_grad():
|
68 |
data = imagenet_transform(input_image).unsqueeze(0)
|
69 |
+
# data = data.cuda()
|
70 |
reference_layer4 = wrapped_model(data)
|
71 |
|
72 |
return reference_layer4.data.to('cpu').numpy()
|