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

Epoch Training: Help #97

Open
ludwigwittgenstein2 opened this issue Jun 20, 2022 · 1 comment
Open

Epoch Training: Help #97

ludwigwittgenstein2 opened this issue Jun 20, 2022 · 1 comment

Comments

@ludwigwittgenstein2
Copy link

ludwigwittgenstein2 commented Jun 20, 2022

Not sure, what is wrong?
Any suggestions

/usr/local/lib/python3.7/dist-packages/torch/nn/reduction.py:42: UserWarning: size_average and reduce args will be deprecated, please use reduction='sum' instead.
warnings.warn(warning.format(ret))
/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:20: UserWarning: nn.init.xavier_uniform is now deprecated in favor of nn.init.xavier_uniform
.

TypeError Traceback (most recent call last)
in ()
9 model.train()
10 run_epoch(data_gen(V, 30, 20), model,
---> 11 SimpleLossCompute(model.generator, criterion, model_opt))
12
13 model.eval()

10 frames
in forward(self, x)
7
8 def forward(self,x):
----> 9 mean = x.mean(-1, keepdmin=True)
10 std=x.std(-1, keepdim=True)
11 return self.a_2 * (x-mean)/(std+self.eps)+self.b_2

TypeError: mean() received an invalid combination of arguments - got (int, keepdmin=bool), but expected one of:

  • (*, torch.dtype dtype)
    didn't match because some of the keywords were incorrect: keepdmin
  • (tuple of ints dim, bool keepdim, *, torch.dtype dtype)
  • (tuple of names dim, bool keepdim, *, torch.dtype dtype)
@pengzhangzhi
Copy link

----> 9 mean = x.mean(-1, keepdmin=True)
keepdmin is a typo, the correct argument is keepdim

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