[go: nahoru, domu]

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

[Bug]: 'NoneType' object has no attribute 'from_pretrained' -超长文本分类任务训练报错 #8621

Open
1 task done
jidechao opened this issue Jun 18, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jidechao
Copy link

软件环境

- paddlepaddle:
- paddlepaddle-gpu: 
- paddlenlp:

重复问题

  • I have searched the existing issues

错误描述

[2024-06-18 17:39:15,317] [    INFO] - tokenizer config file saved in /root/.paddlenlp/models/ernie-doc-base-zh/tokenizer_config.json
[2024-06-18 17:39:15,317] [    INFO] - Special tokens file saved in /root/.paddlenlp/models/ernie-doc-base-zh/special_tokens_map.json
Traceback (most recent call last):
  File "/data/llms/github_code/PaddleNLP-release-2.8/examples/text_classification/ernie_doc/train.py", line 345, in <module>
    do_train(args)
  File "/data/llms/github_code/PaddleNLP-release-2.8/examples/text_classification/ernie_doc/train.py", line 181, in do_train
    model = ErnieDocForSequenceClassification.from_pretrained(args.model_name_or_path, num_classes=num_classes)
  File "/data/llms/github_code/PaddleNLP-release-2.8/paddlenlp/transformers/model_utils.py", line 2087, in from_pretrained
    config, model_kwargs = cls.config_class.from_pretrained(
AttributeError: 'NoneType' object has no attribute 'from_pretrained'

稳定复现步骤 & 代码

python train.py --batch_size 4 \
--model_name_or_path ernie-doc-base-zh \
--epoch 5 \
--output_dir ./checkpoints/

@jidechao jidechao added the bug Something isn't working label Jun 18, 2024
@DesmonDay
Copy link
Contributor

我这边可以正常加载哦,不会有你的这个报错,你的paddlenlp版本是啥呢?看看能不能更新一下。

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

2 participants