Spaces:
Running
on
Zero
Running
on
Zero
Dan Bochman
commited on
cast input_tensor to cuda after acquiring zero gpu
Browse files
app.py
CHANGED
@@ -113,6 +113,7 @@ model.eval()
|
|
113 |
@torch.inference_mode()
|
114 |
def run_model(input_tensor, height, width):
|
115 |
model.to("cuda") # set the device after acquiring it with ZERO
|
|
|
116 |
output = model(input_tensor)
|
117 |
output = torch.nn.functional.interpolate(output, size=(height, width), mode="bilinear", align_corners=False)
|
118 |
_, preds = torch.max(output, 1)
|
|
|
113 |
@torch.inference_mode()
|
114 |
def run_model(input_tensor, height, width):
|
115 |
model.to("cuda") # set the device after acquiring it with ZERO
|
116 |
+
input_tensor = input_tensor.to("cuda")
|
117 |
output = model(input_tensor)
|
118 |
output = torch.nn.functional.interpolate(output, size=(height, width), mode="bilinear", align_corners=False)
|
119 |
_, preds = torch.max(output, 1)
|