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

How to reproduce baseline in which label_feat is None? #14

Open
mingyangligithub opened this issue Jun 6, 2024 · 2 comments
Open

How to reproduce baseline in which label_feat is None? #14

mingyangligithub opened this issue Jun 6, 2024 · 2 comments

Comments

@mingyangligithub
Copy link

Hi Authors,

I'm trying to reproduce the baseline which is without embedding of descriptions of codes. In icd_mode.py, I set the label_feat equals to None. But it shows error when I run the code. How can I reproduce it?
# ignore mc_logits
#c_logits0 = self.decoder(hidden0, word_mask, label_feats)
#c_logits1 = self.decoder(hidden1, word_mask, label_feats)
c_logits0 = self.decoder(hidden0, word_mask, label_feat = None)
c_logits1 = self.decoder(hidden1, word_mask, label_feat = None)

Many thanks!
Best wishes,
Mingyang

@mingyangligithub
Copy link
Author

This is the error:
Traceback (most recent call last):
File "main.py", line 254, in
main()
File "main.py", line 251, in main
run(args)
File "main.py", line 87, in run
epoch_dev_metric, epoch_test_metric, steps = train_one_epoch(model, steps, train_dataloader, dev_dataloader, test_dataloader, optimizer, scheduler_step, args, accelerator)
File "main.py", line 155, in train_one_epoch
ori_loss = model(batch_gpu, rdrop=args.rdrop_alpha > 0.0)
File "/mnt/iusers01/fatpou01/compsci01/f06585ml/anaconda3/envs/MSMN/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/iusers01/fatpou01/compsci01/f06585ml/ICD-MSMN/model/icd_model.py", line 56, in forward
return self.forward_rdrop(batch)
File "/mnt/iusers01/fatpou01/compsci01/f06585ml/ICD-MSMN/model/icd_model.py", line 93, in forward_rdrop
c_logits0 = self.decoder(hidden0, word_mask, label_feat = None)
File "/mnt/iusers01/fatpou01/compsci01/f06585ml/anaconda3/envs/MSMN/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/iusers01/fatpou01/compsci01/f06585ml/ICD-MSMN/model/decoder.py", line 205, in forward
m = self.get_label_queried_features(h, word_mask, label_feat)
File "/mnt/iusers01/fatpou01/compsci01/f06585ml/ICD-MSMN/model/decoder.py", line 240, in get_label_queried_features
u_reshape = self.u_reduce(label_feat.reshape(label_count, self.attention_head, att_dim))
RuntimeError: shape '[4, 8, 512]' is invalid for input of size 19968

@GanjinZero
Copy link
Owner

I am not maintaining this repo anymore. Where does the input size 19968 come from? I have no idea.

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