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

fixed f1 score后的TextCNN_train.py中出现操作ValueError #119

Open
GUOXINTONG opened this issue May 12, 2019 · 2 comments
Open

fixed f1 score后的TextCNN_train.py中出现操作ValueError #119

GUOXINTONG opened this issue May 12, 2019 · 2 comments

Comments

@GUOXINTONG
Copy link

line 137: predict = []
line 145: predict += logits[0]

会报错:operands could not be broadcast together with shapes (0,) (n,)
(n是label个数)

原因应该是在循环中空数组和预测值logits的第0维相加出现了维度问题。
我改成了 line 137: predict = np.zeros(n) 解决
不知道只是我的bug吗还是?

@lilyhong420
Copy link

我也出现了这样的问题

@TingNLP
Copy link

TingNLP commented Aug 15, 2019

不太明白为何只加logits[0]
应该把logits全部的结果列表起来与vaild_y计算F1才是?

另外logits的值是sigmoid后的结果?

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

3 participants