PaddleNLP icon indicating copy to clipboard operation
PaddleNLP copied to clipboard

[Question]: Why I can't use my cpu to train the mulit-class models?

Open Yang-yyf opened this issue 1 year ago • 5 comments

请提出你的问题

When I try to run the simple test about paddlenlp -> text_classfy -> mult-class. I meet an error: [2024-03-20 14:23:53,533] [ INFO] - Starting training from resume_from_checkpoint : None Traceback (most recent call last): File "train.py", line 230, in main() File "train.py", line 180, in main train_result = trainer.train() File "/root/zean/venv/lib/python3.8/site-packages/paddlenlp/trainer/trainer.py", line 648, in train self._load_from_checkpoint(resume_from_checkpoint) File "/root/zean/venv/lib/python3.8/site-packages/paddlenlp/trainer/trainer.py", line 510, in _load_from_checkpoint self.runtime_timer.start("checkpoint loading time") File "/root/zean/venv/lib/python3.8/site-packages/paddlenlp/trainer/plugins/timer.py", line 77, in start self.timer.start() File "/root/zean/venv/lib/python3.8/site-packages/paddlenlp/trainer/plugins/timer.py", line 35, in start paddle.device.synchronize() File "/root/zean/venv/lib/python3.8/site-packages/paddle/device/init.py", line 1031, in synchronize raise TypeError( TypeError: device should be gpu, xpu,

But I think it can support cpu train mode. Why I can see this error?

Here is my version info: paddlepaddle-2.6.1 paddlenlp-2.7.2 Python 3.8.10 Ubuntu 20.04

Yang-yyf avatar Mar 20 '24 06:03 Yang-yyf

推荐paddle使用2.3/2.4 paddlenlp使用2.5.1

lugimzzz avatar Mar 22 '24 05:03 lugimzzz

@lugimzzz 推荐paddle使用2.3/2.4 paddlenlp使用2.5.1

我按你的建议换成这两个版本了,但是报错了,这个应该怎么解决: Ubuntu报错

dghlnvyps avatar Apr 19 '24 07:04 dghlnvyps

请问你的paddle版本是多少?fluid在2.6.0版本已经去除了,可以使用2.5.2版本

w5688414 avatar May 13 '24 02:05 w5688414

Is there a good solution to this problem?

TypeError: device should be gpu, xpu,

SmallStom avatar Jun 21 '24 08:06 SmallStom

This issue is stale because it has been open for 60 days with no activity. 当前issue 60天内无活动,被标记为stale。

github-actions[bot] avatar Aug 21 '24 00:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale. 当前issue 被标记为stale已有14天,即将关闭。

github-actions[bot] avatar Sep 04 '24 00:09 github-actions[bot]