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

关于UIE模型微调,如何进行一机多卡训练? #47

Open
zhougz2018 opened this issue Apr 14, 2023 · 2 comments
Open

关于UIE模型微调,如何进行一机多卡训练? #47

zhougz2018 opened this issue Apr 14, 2023 · 2 comments

Comments

@zhougz2018
Copy link

No description provided.

@HarderThenHarder
Copy link
Owner

Hi,您可以在 这一行后面 通过加入下面一行简单的命令来实现多卡训练:

...
model.to(args.device)

[+] model = torch.nn.DataParallel(model, device_ids=[0, 1, 2])            # 需要用的显卡索引

tokenizer = AutoTokenizer.from_pretrained(args.pretrained_model)
...

@zhougz2018
Copy link
Author

我的文本长度 5000 ,内存就爆了,数据需要处理吗?

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

2 participants