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

A mistake in train.py line 48 #32

Open
705062791 opened this issue Mar 12, 2021 · 0 comments
Open

A mistake in train.py line 48 #32

705062791 opened this issue Mar 12, 2021 · 0 comments

Comments

@705062791
Copy link

the code is:

log_p = torch.log_softmax(pred_score, dim=1).reshape(-1, n_class)

where "pred_score" is a (n_batch, n_class, n_frame) tensor. then, doing log_softmax on it and reshape it in (-1,n_class). However, function "reshape" default in "Row first" mode, and we need "Col frist" mode here. the right code is:

log_p = torch.log_softmax(pred_score, dim=1).permute(0,2,1).reshape(-1, n_class)
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