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

跑train_adalora_seq2seq模型微调时出现错误AttributeError: 'Linear' object has no attribute 'in_channels' #1691

Open
liuyifan123123 opened this issue Sep 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@liuyifan123123
Copy link
Contributor

Describe the bug/ 问题描述 (Mandatory / 必填)
Screenshot 2024-09-27 132609
Screenshot 2024-09-27 132602

A clear and concise description of what the bug is.
报错:AttributeError: 'Linear' object has no attribute 'in_channels'

  • Hardware Environment(Ascend/GPU/CPU) / 硬件环境:
  • Ascend

/device ascend/GPU/CPU/kirin/等其他芯片
device ascend

  • Software Environment / 软件环境 (Mandatory / 必填):
  • mindnlp0.4
    -- MindSpore version (e.g., 1.7.0.Bxxx) :
    mindspore2.3.1
    -- Python version (e.g., Python 3.7.5) :
    3.9.10
    -- OS platform and distribution (e.g., Linux Ubuntu 16.04):
    EluerOS
    -- GCC/Compiler version (if compiled from source):

To Reproduce / 重现步骤 (Mandatory / 必填)
简单示例如下,调用的facebook/bart-base模型
import os
os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE"
from mindnlp.transformers import AutoModelForSeq2SeqLM
model_name_or_path = "facebook/bart-base"
from mindnlp.peft import AdaLoraConfig, TaskType, get_peft_model
model = AutoModelForSeq2SeqLM.from_pretrained(model_name_or_path)
peft_config = AdaLoraConfig(
init_r=12,
target_r=8,
beta1=0.85,
beta2=0.85,
tinit=200,
tfinal=1000,
deltaT=10,
lora_alpha=32,
lora_dropout=0.1,
task_type=TaskType.SEQ_2_SEQ_LM,
inference_mode=False,
)
model = get_peft_model(model, peft_config)

@liuyifan123123 liuyifan123123 added the bug Something isn't working label Sep 27, 2024
@liuyifan123123 liuyifan123123 changed the title AttributeError: 'Linear' object has no attribute 'in_channels' 跑train_adalora_seq2seq模型微调时出现错误AttributeError: 'Linear' object has no attribute 'in_channels' Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant