Skip to content

KeyError: 'pi' #6

@zhousteven

Description

@zhousteven

System enviroment:
Ubuntu20.04
torch 2.0.0+cu118
torchvision 0.15.1+cu118

Commandline:
#run_vqav2_ft.py --train_config_file=vqa_train_config.json

Error Description as below:
/home/steven/anaconda3/envs/nlp/bin/python /home/steven/workstore/nlp/VLE-main/run_vqav2_ft.py --train_config_file=vqa_train_config.json
/home/steven/workstore/nlp/VLE-main/run_vqav2_ft.py:76: SyntaxWarning: "is" with a literal. Did you mean "=="?
max_epochs=_config["max_epoch"] if max_steps is -1 else 1000,
2023-09-20 13:52:41.071596: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
Global seed set to 0
Some weights of VLEForVQA were not initialized from the model checkpoint at hfl/vle-base and are newly initialized: ['vqa_classifier.1.bias', 'vqa_classifier.3.bias', 'vqa_classifier.3.weight', 'vqa_classifier.0.bias', 'vqa_classifier.1.weight', 'vqa_classifier.0.weight']
You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.
Traceback (most recent call last):
File "/home/steven/workstore/nlp/VLE-main/run_vqav2_ft.py", line 107, in
main(train_config)
File "/home/steven/workstore/nlp/VLE-main/run_vqav2_ft.py", line 25, in main
model = VLEForVQA_PL(_config)
File "/home/steven/workstore/nlp/VLE-main/vqav2_train_module.py", line 73, in init
new_state_dict = extend_position_embedding(self.model.state_dict(), patch_size, config["image_size"])
File "/home/steven/workstore/nlp/VLE-main/models/VLE/modeling_vle.py", line 124, in extend_position_embedding
state_dict[keys['pi'][0]] = torch.arange(grid_after*grid_after + 1).unsqueeze(0)
KeyError: 'pi'

Process finished with exit code 1

when i debug step by step, i found that cannot found key value "vision_model.embeddings.position_ids" in parameters list of model 'vle-base'.
Any body encounter same question as me?
please kindly help to solve this problem!
Tks~

Metadata

Metadata

Assignees

No one assigned

    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