Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chuch1983 opened this issue Dec 18, 2023 · 1 comment
Open

Comments

@chuch1983
Copy link

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
Copy link
Collaborator

Thanks for your issue. Bug was fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants