OpenGVLab / Ask-Anything

[CVPR2024 Highlight][VideoChatGPT] ChatGPT with video understanding! And many more supported LMs such as miniGPT4, StableLM, and MOSS.
https://vchat.opengvlab.com/
MIT License
2.86k stars 230 forks source link

AttributeError: 'LlamaForCausalLM' object has no attribute 'logger' #87

Open chuch1983 opened 6 months ago

chuch1983 commented 6 months ago

error log Traceback (most recent call last): File "/opt/conda/lib/python3.10/site-packages/peft/peft_model.py", line 288, in getattr return super().getattr(name) # defer to nn.Module's logic File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1265, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'PeftModelForCausalLM' object has no attribute 'logger'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/opt/conda/lib/python3.10/site-packages/peft/tuners/lora.py", line 278, in getattr return super().getattr(name) # defer to nn.Module's logic File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1265, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'LoraModel' object has no attribute 'logger'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/xiaobingding/Ask-Anything-main/video_chat2/tasks/train_it.py", line 218, in main(cfg) File "/home/xiaobingding/Ask-Anything-main/video_chat2/tasks/train_it.py", line 154, in main ) = setup_model( File "/opt/conda/lib/python3.10/site-packages/tasks/shared_utils.py", line 45, in setup_model model = model_cls(config=config.model) File "/opt/conda/lib/python3.10/site-packages/models/videochat2_it.py", line 151, in init self.llama_model.logger.info_trainable_parameters() File "/opt/conda/lib/python3.10/site-packages/peft/peft_model.py", line 290, in getattr return getattr(self.base_model, name) File "/opt/conda/lib/python3.10/site-packages/peft/tuners/lora.py", line 280, in getattr return getattr(self.model, name) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1265, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'LlamaForCausalLM' object has no attribute 'logger'

torch 1.13.0+cu117 torchvision 0.14.1+cu117

版本 报错

Andy1621 commented 6 months ago

Thanks for your issue. Bug was fixed!