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

运行bash ./scripts/kgc/knnkge.sh时报错AttributeError: 'KNNKGEPretrainLitModel' object has no attribute 'model' #46

Closed
Roger-Ni opened this issue Nov 9, 2023 · 7 comments
Labels
question Further information is requested

Comments

@Roger-Ni
Copy link

Roger-Ni commented Nov 9, 2023

截图 2023-11-09 16-51-12
我想训练knn-kg模型,出现如上图所示错误。

@CheaSim
Copy link
Collaborator

CheaSim commented Nov 10, 2023

请问一下transformers和pytorch_lightning的版本,以及模型文件是否成功下载。

@Roger-Ni
Copy link
Author

transformers==4.15.0 pytorch_lighting==1.6.0 .模型文件的话,我看knnkge.sh文件中写的是model_name_or_path="bert-base-uncased",就认为应该是下载bert的模型,我就下载到了如下图所示的目录下。
截图 2023-11-10 14-41-01
然后bert-base-uncased文件夹下的文件应该也是齐全的(如下图所示)
截图 2023-11-10 14-42-12

@CheaSim
Copy link
Collaborator

CheaSim commented Nov 19, 2023

请把transformers 版本和requirements.txt 保持一致。

transformers==4.6.0

@zxlzr
Copy link
Contributor

zxlzr commented Nov 21, 2023

请问您的问题是否已解决

@zxlzr zxlzr added the question Further information is requested label Nov 21, 2023
@Roger-Ni
Copy link
Author

我把transformers和pytorch_lighting都配置成了rquirements中的版本,但是运行时,还是会出现如下错误。
截图 2023-11-24 18-12-48

@CheaSim
Copy link
Collaborator

CheaSim commented Nov 29, 2023

这个貌似是transformers版本的问题,麻烦您使用python3.8 并且transformers更新到4.6.0.
请先执行

pip install -r requirements.txt

再运行我们的脚本~

@zxlzr
Copy link
Contributor

zxlzr commented Nov 30, 2023

请问您的问题是否已解决?

@zxlzr zxlzr closed this as completed Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants