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

TypeError: normal_() got an unexpected keyword argument 'generator' #723

Open
StarHtimE opened this issue Aug 2, 2024 · 1 comment
Open

Comments

@StarHtimE
Copy link

Traceback (most recent call last):
File "/root/llm.c/train_gpt2.py", line 663, in
model = GPT.from_pretrained(args.model)
File "/root/llm.c/train_gpt2.py", line 210, in from_pretrained
model = GPT(config)
File "/root/llm.c/train_gpt2.py", line 147, in init
self.apply(self.init_weights)
File "/root/miniconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 897, in apply
module.apply(fn)
File "/root/miniconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 897, in apply
module.apply(fn)
File "/root/miniconda3/lib/python3.10/site-packages/torch/nn/modules/module.py", line 898, in apply
fn(self)
File "/root/llm.c/train_gpt2.py", line 160, in init_weights
torch.nn.init.normal
(module.weight, mean=0.0, std=0.02, generator=self.init_rng)
TypeError: normal
() got an unexpected keyword argument 'generator'
image

@StarHtimE
Copy link
Author

How to solve this issue?

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