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

Baichuan2-13B-Chat-4bits 微调报错 #421

Open
pjw-cmd opened this issue Sep 11, 2024 · 0 comments
Open

Baichuan2-13B-Chat-4bits 微调报错 #421

pjw-cmd opened this issue Sep 11, 2024 · 0 comments

Comments

@pjw-cmd
Copy link

pjw-cmd commented Sep 11, 2024

我在linux环境下跑Baichuan2-13B-Chat-4bits这个模型报错:
这是报错信息:[rank0]: Traceback (most recent call last):
[rank0]: File "/data/anaconda3/envs/py310/lib/python3.10/site-packages/peft/peft_model.py", line 737, in getattr
[rank0]: return super().getattr(name) # defer to nn.Module's logic
[rank0]: File "/data/anaconda3/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1729, in getattr
[rank0]: raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
[rank0]: AttributeError: 'PeftModelForCausalLM' object has no attribute 'hf_quantizer'

[rank0]: During handling of the above exception, another exception occurred:

[rank0]: Traceback (most recent call last):
[rank0]: File "/data/anaconda3/envs/py310/lib/python3.10/site-packages/peft/tuners/lora/model.py", line 356, in getattr
[rank0]: return super().getattr(name) # defer to nn.Module's logic
[rank0]: File "/data/anaconda3/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1729, in getattr
[rank0]: raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
[rank0]: AttributeError: 'LoraModel' object has no attribute 'hf_quantizer'

[rank0]: During handling of the above exception, another exception occurred:

[rank0]: Traceback (most recent call last):
[rank0]: File "/data2/pengjw/Baichuan2/fine-tune/fine-tune.py", line 153, in
[rank0]: train()
[rank0]: File "/data2/pengjw/Baichuan2/fine-tune/fine-tune.py", line 144, in train
[rank0]: trainer = transformers.Trainer(
[rank0]: File "/data/anaconda3/envs/py310/lib/python3.10/site-packages/transformers/trainer.py", line 489, in init
[rank0]: f"The model you are trying to fine-tune is quantized with {model.hf_quantizer.quantization_config.quant_method}"
[rank0]: File "/data/anaconda3/envs/py310/lib/python3.10/site-packages/peft/peft_model.py", line 741, in getattr
[rank0]: return getattr(self.base_model, name)
[rank0]: File "/data/anaconda3/envs/py310/lib/python3.10/site-packages/peft/tuners/lora/model.py", line 360, in getattr
[rank0]: return getattr(self.model, name)
[rank0]: File "/data/anaconda3/envs/py310/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1729, in getattr
[rank0]: raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
[rank0]: AttributeError: 'BaichuanForCausalLM' object has no attribute 'hf_quantizer'. Did you mean: 'is_quantized'?
[2024-09-11 10:31:54,330] [INFO] [launch.py:319:sigkill_handler] Killing subprocess 22049
[2024-09-11 10:31:54,330] [ERROR] [launch.py:325:sigkill_handler] ['/data/anaconda3/envs/py310/bin/python', '-u', 'fine-tune.py', '--local_rank=0', '--report_to', 'none', '--data_path', 'data/belle_chat_ramdon_10k.json', '--model_name_or_path', '/data2/pengjw/Baichuan2/model_pth/Baichuan2-13B-Chat-4bits', '--output_dir', 'output', '--model_max_length', '512', '--num_train_epochs', '4', '--per_device_train_batch_size', '16', '--gradient_accumulation_steps', '1', '--save_strategy', 'epoch', '--learning_rate', '2e-5', '--lr_scheduler_type', 'constant', '--adam_beta1', '0.9', '--adam_beta2', '0.98', '--adam_epsilon', '1e-8', '--max_grad_norm', '1.0', '--weight_decay', '1e-4', '--warmup_ratio', '0.0', '--logging_steps', '1', '--gradient_checkpointing', 'True', '--deepspeed', 'ds_config.json', '--bf16', 'True', '--tf32', 'True', '--use_lora', 'True'] exits with return code = 1
有大佬可以帮忙看下是什么原因吗?非常感谢。

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

No branches or pull requests

1 participant