Dan Bochman commited on
Commit
6db27b1
·
unverified ·
1 Parent(s): 3a1cfd0

cast input_tensor to cuda after acquiring zero gpu

Browse files
Files changed (1) hide show
  1. app.py +1 -0
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)