psunlpgroup / CONTaiNER

Code for ACL 2022 paper "CONTaiNER: Few-Shot Named Entity Recognition via Contrastive Learning"
MIT License
112 stars 18 forks source link

why this problem occurs? #9

Open cschy opened 2 years ago

cschy commented 2 years ago

File "D:/Project/CONTaiNER/src/container.py", line 790, in main() File "D:/Project/CONTaiNER/src/container.py", line 707, in main global_step, tr_loss = train(args, train_dataset, model) File "D:/Project/CONTaiNER/src/container.py", line 142, in train outputs = model(*inputs) File "D:\Project\CONTaiNER\venv\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(input, *kwargs) File "D:\Project\CONTaiNER\src\utils.py", line 191, in forward loss = calculate_KL_or_euclidean(self, attention_mask, original_embedding_mu, File "D:\Project\CONTaiNER\src\utils.py", line 115, in calculate_KL_or_euclidean assert len(repeated_labels) == (filtered_instances_nos filtered_instances_nos), "dimension is not of square shape." AssertionError: dimension is not of square shape. python-BaseException

sorry to bother you, can you help me?

gangtie95 commented 1 year ago

I have the same problem. Hope that some solve method.