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

output the uodated label #59

Closed
tanjia123456 opened this issue Oct 26, 2020 · 0 comments
Closed

output the uodated label #59

tanjia123456 opened this issue Oct 26, 2020 · 0 comments

Comments

@tanjia123456
Copy link

Hello, I recently wanted to output the updated labels, so I added a pred_tr in the training phase:

_, loss_value_tr, acc_tr,pred_tr = sess.run([train_op, loss, accuracy,log_resh]

Then, I found that pred_tr is indeed (2708, 7) but the value inside is positive or negative. I used the following code to output the updated label
with open("./embeddings_target.txt", "w") as fe, open("./labels_target.txt", 'w') as fl: for i in range(len(pred_tr)): fl.write(label_dict[int(list(pred_tr[i]).index(1.))]+ "\n") fe.write(" ".join(map(str, pred_tr[i])) + "\n")
the error occurs: ValueError: 1.0 is not in list

I just want to ask, the probability of each node for the 7 categories has positive and negative numbers. What should I do?

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