Solved by albanD in post #2 
              
              
                Hi, you should change it to: 
def batchrun(image_batch, model):
  image_batch = torch.tensor(image_batch, dtype=torch.float32, device="cuda")
  with torch.no_grad():
    feats = model(image_batch)
  feats = feats.detach().cpu().clone().numpy()
  return feats