SAI990323 / TALLRec

Apache License 2.0
190 stars 31 forks source link

库的版本依赖问题 #47

Closed plyplyply closed 6 months ago

plyplyply commented 6 months ago

您好,感谢您开源这个有趣的工作。但是我在运行时报错:

Traceback (most recent call last): File "/home/faet/pyh/pyh-22210860014/proj/llama/finetune_rec.py", line 330, in fire.Fire(train) File "/home/faet/anaconda3/envs/ll/lib/python3.8/site-packages/fire/core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/home/faet/anaconda3/envs/ll/lib/python3.8/site-packages/fire/core.py", line 475, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/home/faet/anaconda3/envs/ll/lib/python3.8/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/home/faet/pyh/pyh-22210860014/proj/llama/finetune_rec.py", line 215, in train model.print_trainable_parameters() # Be more transparent about the % of trainable params. AttributeError: '_IncompatibleKeys' object has no attribute 'print_trainable_parameters' 或是报错:

Traceback (most recent call last): File "/home/faet/pyh/pyh-22210860014/proj/llama/finetune_rec.py", line 330, in fire.Fire(train) File "/home/faet/anaconda3/envs/ll/lib/python3.8/site-packages/fire/core.py", line 141, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/home/faet/anaconda3/envs/ll/lib/python3.8/site-packages/fire/core.py", line 475, in _Fire component, remaining_args = _CallAndUpdateTrace( File "/home/faet/anaconda3/envs/ll/lib/python3.8/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "/home/faet/pyh/pyh-22210860014/proj/llama/finetune_rec.py", line 250, in train trainer = transformers.Trainer( File "/home/faet/anaconda3/envs/ll/lib/python3.8/site-packages/transformers/trainer.py", line 686, in init default_label_names = find_labels(self.model.class) File "/home/faet/anaconda3/envs/ll/lib/python3.8/site-packages/transformers/utils/generic.py", line 428, in find_labels signature = inspect.signature(model_class.forward) # PyTorch models AttributeError: type object '_IncompatibleKeys' has no attribute 'forward'

我猜想这是peft库的版本问题?我所使用的版本分别为: bitsandbytes:0.42.0 transformers:4.31.0 peft:0.8.2 请问您的库版本具体是什么?是否可以提供作为参考?感谢~

anjiajun39 commented 4 months ago

@plyplyply 您好,请问你是如何解决AttributeError: '_IncompatibleKeys' object has no attribute 'print_trainable_parameters'这个问题的,谢谢! Hello, can you tell me how to solve the problem AttributeError: '_IncompatibleKeys' object has no attribute 'print_trainable_parameters', thank you!