Closed Buffalo-q closed 1 year ago
Hello author, I encountered a runtime error while running CWQ code. Could you please take a look at the issue when you have time. run:python demo_cwq.py --input_dir data/CWQ --save_dir checkpoints/CWQ --ckpt checkpoints/CWQ/model_cwq.pt response: Traceback (most recent call last): File "demo_cwq.py", line 120, in main() File "demo_cwq.py", line 116, in main test(args) File "demo_cwq.py", line 41, in test model.load_state_dict(torch.load(args.ckpt)) File "/root/miniconda3/envs/GFC/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1604, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for GFC: size mismatch for rel_classifier.weight: copying a param with shape torch.Size([13298, 768]) from checkpoint, the shape in current model is torch.Size([6649, 768]). size mismatch for rel_classifier.bias: copying a param with shape torch.Size([13298]) from checkpoint, the shape in current model is torch.Size([6649]).
you should run:python demo_cwq.py --input_dir data/CWQ --save_dir checkpoints/CWQ --ckpt checkpoints/CWQ/model_cwq.pt --rev please add --rev, then 6649*2=13298 will be right.
Thank you very much.I'll try again.
Hello author, I encountered a runtime error while running CWQ code. Could you please take a look at the issue when you have time. run:python demo_cwq.py --input_dir data/CWQ --save_dir checkpoints/CWQ --ckpt checkpoints/CWQ/model_cwq.pt response: Traceback (most recent call last): File "demo_cwq.py", line 120, in
main()
File "demo_cwq.py", line 116, in main
test(args)
File "demo_cwq.py", line 41, in test
model.load_state_dict(torch.load(args.ckpt))
File "/root/miniconda3/envs/GFC/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1604, in load_state_dict
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for GFC:
size mismatch for rel_classifier.weight: copying a param with shape torch.Size([13298, 768]) from checkpoint, the shape in current model is torch.Size([6649, 768]).
size mismatch for rel_classifier.bias: copying a param with shape torch.Size([13298]) from checkpoint, the shape in current model is torch.Size([6649]).