DAMO-NLP-SG / DAMO-NLP-SG/VCD

ValueError: Unable to create tensor, you should probably activate padding with 'padding=True' to have batched tensors with the same length.

Open
#32 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
418
Forks
27
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am currently running the code `object_hallucination_vqa_llava`, and I got this error:
```
Traceback (most recent call last):
File "/VCD/experiments/eval/object_hallucination_vqa_llava.py", line 128, in
eval_model(args)
File "/VCD/experiments/eval/object_hallucination_vqa_llava.py", line 60, in eval_model
image_preprocessed = image_processor.preprocess(image, return_tensors='pt')
File "/opt/conda/envs/vcd/lib/python3.9/site-packages/transformers/models/clip/image_processing_clip.py", line 337, in preprocess
return BatchFeature(data=data, tensor_type=return_tensors)
File "/opt/conda/envs/vcd/lib/python3.9/site-packages/transformers/feature_extraction_utils.py", line 78, in __init__
self.convert_to_tensors(tensor_type=tensor_type)
File "/opt/conda/envs/vcd/lib/python3.9/site-packages/transformers/feature_extraction_utils.py", line 181, in convert_to_tensors
raise ValueError(
ValueError: Unable to create tensor, you should probably activate padding with 'padding=True' to have batched tensors with the same length.
```
I followed README to create my environment, and then changed some path parameters in `object_hallucination_vqa_llava.py`. Please let me know if you need more information.
Thank you

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the README setup and reproduce object_hallucination_vqa_llava, then inspect eval_model in experiments/eval/object_hallucination_vqa_llava.py around line 60 and the image_processor.preprocess call. Confirm the dependency versions and changed paths, and use the traceback to isolate the preprocessing input; done means a reproducible diagnosis and verified resolution are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.