Code for batch inference?

#1
by tariksetia - opened
frames = [.....List of PIL.Image....]
 inputs = processor(images=frames, text=text, return_tensors="pt").to(device)

with torch.no_grad():
     outputs = model(**inputs)
 print(outputs)
RuntimeError: The size of tensor a (3) must match the size of tensor b (6) at non-singleton dimension 2

@tariksetia If you're passing a list of length N your text should also be a list of length N and if the text that you're using doesn't match in their length (in tokens) you should also pass padding=True

Sign up or log in to comment