Skip to content

RunTime Error of metric 'scene', when decoding with BertLMHeadModel #156

@WenkunHe

Description

@WenkunHe

When I tried to evaluate a bunch of generated videos on the metric 'scene', I encountered the following problem:

File "/xxx/anaconda3/envs/vbench/lib/python3.10/site-packages/vbench/third_party/tag2Text/tag2text.py", line 192, in generate
outputs = self.text_decoder.generate(input_ids=input_ids,
File "/xxx/anaconda3/envs/vbench/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1928, in __getattr__
raise AttributeError(
AttributeError: 'BertLMHeadModel' object has no attribute 'generate'

And it seems to make sense for me:

  1. In the function compute_scene of scene.py, we define model through function tag2text_caption in third_party/tag2Text/tag2text.py, which is linked to module Tag2Text_Caption.
  2. In Tag2Text_Caption, we claim that self.text_decoder = BertLMHeadModel(config=decoder_config), and call self.text_decoder.generate no matter whether sample=True in function generate.
  3. BertLMHeadModel in third_party/tag2Text/med.py actually does not have such function generate, and its ancestors BertPreTrainedModel and PreTrainedModel also do not define generate.

Could anyone help me to solve the problem?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions