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

I have a bug about class Confusion.add() #10

Open
oYoungCo opened this issue Sep 8, 2021 · 10 comments
Open

I have a bug about class Confusion.add() #10

oYoungCo opened this issue Sep 8, 2021 · 10 comments

Comments

@oYoungCo
Copy link

oYoungCo commented Sep 8, 2021

Thank you for your work, i'm interested in your work. Then, I run this project on SearchSnippets, but when I get pred_labels and true_labels then to execute confusion.add(pred_labels, true_labels), I get a problem:self.conf_flat.index_add(0, indices, ones) {IndexError}index out of range in self. The two input parameters:output, target about add() are output={Tensor:(12195,)}tensor([6, 6, 7, ..., 0, 0, 0], device='cuda:0'), target={Tensor:(12195,)}tensor([1, 1, 1, ..., 8, 8, 8]), respectively. I am confused about this problem and i have no idea about the role of add(). Could you please give me some advice?

@l770943527
Copy link

l770943527 commented Sep 10, 2021

I have the same error, I guess this is for calculating the acc of cluster and ground-truth label, here is a link may be helpful https://smorbieu.gitlab.io/accuracy-from-classification-to-clustering-evaluation/

@oYoungCo
Copy link
Author

@l770943527 Thanks for your help. I will try it. I have a question: can the method proposed in this paper be used for incremental clustering?

@MrRace
Copy link

MrRace commented Sep 24, 2021

@Dejiao2018 I use searchsnippets.csv to run the project, but when run to this line in utils/metric.py:
self.conf_flat.index_add(0, indices, ones)
It comes error:

  File "main.py", line 95, in <module>
    run(get_args(sys.argv[1:]))
  File "main.py", line 45, in run
    cluster_centers = get_kmeans_centers(sbert, train_loader, args.num_classes)
  File "/home/nlp_clustering/sccl/utils/kmeans.py", line 43, in get_kmeans_centers
    confusion.add(pred_labels, true_labels)
  File "/home/nlp_clustering/sccl/utils/metric.py", line 101, in add
    self._conf_flat.index_add_(0, indices, ones)
IndexError: index out of range in self

@MrRace
Copy link

MrRace commented Sep 24, 2021

@l770943527 Thanks for your help. I will try it. I have a question: can the method proposed in this paper be used for incremental clustering?

Same error, have you fix it out?

@remember00000
Copy link

Same error, have you fix it out?

@ScarletYarn
Copy link

I also have the same error :(
Is this caused by the data I'm using? I'm using searchsnippets downloaded from Kaggle.
Do u guys get some data that can be used?

@336655asd
Copy link

336655asd commented Dec 1, 2021

There is nothing to datasets, it's just a bug. I read all the codes and find that metrics.py has many problems. You just need to write your own evaluation code.

@urospet
Copy link

urospet commented Dec 7, 2021

Same error, have you fix it out?

@urospet
Copy link

urospet commented Dec 8, 2021

I used my own accuracy method, here is a working copy : https://www.kaggle.com/urospetricevic/sccl-reproduction

@oYoungCo
Copy link
Author

There is nothing to datasets, it's just a bug. I read all the codes and find that metrics.py has many problems. You just need to write your own evaluation code.

yes, you are right.

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

7 participants