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

[cli] switch to torch backend #227

Merged
merged 4 commits into from
Nov 13, 2023
Merged

[cli] switch to torch backend #227

merged 4 commits into from
Nov 13, 2023

Conversation

robin1001
Copy link
Collaborator

No description provided.

outputs = self.session.run(None, {"feats": feats})
embedding = outputs[0][0]
pcm = pcm.to(torch.float)
feats = kaldi.fbank(pcm,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

重采样要不加一下

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我先合,你来加下。

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外现在这个好像不能直接用gpu,我刚才测试gpu 的时候还是需要分步骤去做的,需要把feats 转cuda,模型转cuda,最后输出的再转回去

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from numpy.linalg import norm

这个import 需要留着的,下边要用

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这块未来都要改成 torch 相关的操作。

outputs = self.session.run(None, {"feats": feats})
embedding = outputs[0][0]
pcm = pcm.to(torch.float)
feats = kaldi.fbank(pcm,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外现在这个好像不能直接用gpu,我刚才测试gpu 的时候还是需要分步骤去做的,需要把feats 转cuda,模型转cuda,最后输出的再转回去

@JiJiJiang JiJiJiang merged commit c6a42a1 into master Nov 13, 2023
3 checks passed
@wsstriving wsstriving deleted the binbin-cli-torch branch November 13, 2023 07:06
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

Successfully merging this pull request may close these issues.

4 participants