-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
'GPT2Decoder' object has no attribute 'decoder' #4
Comments
Hi jinghaoliu, I think I know the issue, I'll fix it and then get back to you. Shouldn't take too long. |
There was an error in the configuration file. I've pushed an update, but the error was caused by lines 131 and 140 of https://github.com/aehrc/cvt2distilgpt2/blob/main/config/cvt_21_to_distilgpt2.py (which has been updated). Thanks for letting me know about this issue. If there are any more issues please let me know. |
Hi Aaron, I have modified these codes according to your reply. The same codes need to be modified :(https://github.com/aehrc/cvt2distilgpt2/blob/main/task/iu_x_ray_chen/config/cvt_21_to_distilgpt2_scst.py The error has been solved by modifying these codes, but I am facing a new error. It still seems to be related to the previous error: TypeError |
Hi jinghaoliu, There were a few issues in: https://github.com/aehrc/cvt2distilgpt2/blob/main/transmodal/generate.py I updated the code a bit after doing these experiments and did not test everything after the updates (silly me). I have run the code through to completion, so it should also work for you now. Please pull the latest version of the repo. I hope this helps and please let me know if there are any more issues. |
Yes, it is very helpful. Thank you. |
Hi Aaron, thank you for your great work. I tried to train for IU X-Ray data. But the program returns this error:
AttributeError
'GPT2Decoder' object has no attribute 'decoder'
File "/media/data/cvt2distilgpt2/transmodal/utils.py", line 234, in _getattr
return getattr(obj, attr, *args)
File "/media/data/cvt2distilgpt2/transmodal/utils.py", line 235, in rgetattr
return functools.reduce(_getattr, [obj] + attr.split('.'))
File "/media/data/cvt2distilgpt2/transmodal/model.py", line 684, in configure_optimizers
named_params = rgetattr(self, k).named_parameters()
File "/media/data/lcvt2distilgpt2/main.py", line 48, in objective
trainer.fit(transmodal, datamodule=dataset)
File "/media/data/cvt2distilgpt2/main.py", line 65, in main
objective(config)
File "/media/data/cvt2distilgpt2/main.py", line 175, in
main(clargs)
I debug the bug, GPT2Decoder only has a similar attribute named 'encoder_decoder'. I suspect the problem is caused by the huggingface checkpoint version not matching your codes. Because the same error also exists in predict mode.
I used your latest repository and installed all needed packages with your pip requirements.txt.
transformers==4.15.0
download CvT2DistilGPT2 checkpoint from your website.
download DistilGPT2 checkpoint from huggingface.
download CvT-21 Checkpoint from Microsoft
download Bert-base-uncased checkpoint from huggingface
download chexbert from stanfordmlgroup repository
The text was updated successfully, but these errors were encountered: