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

Error in code #3

Open
HaseebLUMS opened this issue Oct 24, 2019 · 3 comments
Open

Error in code #3

HaseebLUMS opened this issue Oct 24, 2019 · 3 comments

Comments

@HaseebLUMS
Copy link

File "main.py", line 344, in subtoken_match
exp_subtokens = label_vocab.itosubtokens[expected.item()]
AttributeError: 'int' object has no attribute 'item'

@sonoisa
Copy link
Owner

sonoisa commented Oct 25, 2019

@HaseebLUMS

Did you use pytorch 0.4?
If so, could you use pytorch 1.1?
I checked with 1.1.

@lyyXiDian
Copy link

My pytorch is 1.1.0 cpu-only and python is 3.6.10, the program also has this issues !

@lyyXiDian
Copy link

main.py-->subtoken_match():
exp_subtokens = label_vocab.itosubtokens[expected.item()]
actual_subtokens = label_vocab.itosubtokens[actual.item()]
is fault.

The right codes is :
exp_subtokens = label_vocab.itosubtokens[expected]
actual_subtokens = label_vocab.itosubtokens[actual]

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

3 participants