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: expected Long (got Bool) #8

Closed
Gaojinxiao opened this issue Feb 21, 2020 · 2 comments
Closed

TypeError: expected Long (got Bool) #8

Gaojinxiao opened this issue Feb 21, 2020 · 2 comments

Comments

@Gaojinxiao
Copy link

在训练单模型的时候 现实class_lbls = self.to_var(torch.LongTensor(is_empty))中的TypeError 这个该如何解决 我用的是pytorch1.4版本 是版本的问题的吗 谢谢拉

@luojiashenyu
Copy link

luojiashenyu commented Feb 21, 2020 via email

@Gaojinxiao
Copy link
Author

这个问题解决了 应该是版本兼容的问题 改称torch.LongTensor(is_empty.long())可以解决 但是下面又有坑了 哈哈哈 谢谢啦

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