Image Classification
timm
drhead commited on
Commit
5cb75da
1 Parent(s): 0971830

actually assign the tensor

Browse files
Files changed (1) hide show
  1. inference_gradio.py +1 -1
inference_gradio.py CHANGED
@@ -139,7 +139,7 @@ def create_tags(image, threshold):
139
  if torch.cuda.is_available():
140
  tensor.cuda()
141
  if torch.cuda.get_device_capability()[0] >= 7:
142
- tensor.to(dtype=torch.float16, memory_format=torch.channels_last)
143
 
144
  with torch.no_grad():
145
  logits = model(tensor)
 
139
  if torch.cuda.is_available():
140
  tensor.cuda()
141
  if torch.cuda.get_device_capability()[0] >= 7:
142
+ tensor = tensor.to(dtype=torch.float16, memory_format=torch.channels_last)
143
 
144
  with torch.no_grad():
145
  logits = model(tensor)