unknown commited on
Commit
227ebfb
1 Parent(s): 10d2191

remove cuda usage

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -92,7 +92,7 @@ def predict_image(image_url):
92
  img_cp = np.float32(img_cp) / 255
93
  input_tensor = preprocess_image(img_cp, mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
94
  input_tensor = torch.Tensor(input_tensor)
95
- input_tensor.cuda()
96
 
97
  output = model(input_tensor)
98
  # print(torch.max(output, 1))
@@ -108,7 +108,7 @@ def predict_image(image_url):
108
  img = cv2.resize(img, (224, 224))
109
  img = np.float32(img) / 255
110
  input_tensor = torch.Tensor(input_tensor)
111
- input_tensor.cuda()
112
 
113
  input_tensor = preprocess_image(img, mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
114
  targets = [ClassifierOutputTarget(0)]
 
92
  img_cp = np.float32(img_cp) / 255
93
  input_tensor = preprocess_image(img_cp, mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
94
  input_tensor = torch.Tensor(input_tensor)
95
+ # input_tensor.cuda()
96
 
97
  output = model(input_tensor)
98
  # print(torch.max(output, 1))
 
108
  img = cv2.resize(img, (224, 224))
109
  img = np.float32(img) / 255
110
  input_tensor = torch.Tensor(input_tensor)
111
+ # input_tensor.cuda()
112
 
113
  input_tensor = preprocess_image(img, mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
114
  targets = [ClassifierOutputTarget(0)]