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

predict.py #8

Open
samanthatansy opened this issue Oct 31, 2022 · 2 comments
Open

predict.py #8

samanthatansy opened this issue Oct 31, 2022 · 2 comments

Comments

@samanthatansy
Copy link

Hi, I am trying to only use xlnet model without the gcn for NER. I have ran train.py in the 'xlnet-ner' folder and obtained the saved weights - '4.pt' in a finetuning folder. However, I have issues with the predict.py file.
When I try to run it, I get the following error:
image

I then fixed it by added 'import torch.nn as nn'. However, after that, i get the following error:
image

I am using the same codes, but had only removed .cuda() as I am only using 'cpu'
image

I am not sure what is wrong, please help thank you!

@honghanhh
Copy link
Owner

Hi @samanthatansy,
Make sare that you have already import torch.nn
import torch.nn as nn
Maybe you mistook deleting that line.

@samanthatansy
Copy link
Author

samanthatansy commented Nov 1, 2022

hi i imported torch.nn, but even if i do not delete that line (.cuda) and use GPU (using the same codes as provided exactly), i still get the same error.
Also may I check, must I write anything in the command line arguments? (is it something compulsory to fill?) if yes then what does '--finetuning' and '--top_rnns' mean? thanks!
image

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