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

About KeyError #7

Open
jiaruHithub opened this issue Mar 24, 2020 · 1 comment
Open

About KeyError #7

jiaruHithub opened this issue Mar 24, 2020 · 1 comment

Comments

@jiaruHithub
Copy link

The Error is

Traceback (most recent call last):
File "test_iteration_conf_gnn.py", line 185, in
main()
File "test_iteration_conf_gnn.py", line 136, in main
for index, batch in enumerate(testloader):
File "D:\lib\site-packages\torch\utils\data\dataloader.py", line 615, in next
batch = self.collate_fn([self.dataset[i] for i in indices])
File "D:\lib\site-packages\torch\utils\data\dataloader.py", line 615, in
batch = self.collate_fn([self.dataset[i] for i in indices])
File "D:\muqian\code\AGNN\dataloaders\PairwiseImg_test_new.py", line 115, in getitem
my_index = self.Index[seq_name1]
KeyError: '480p'

i don't know how to tackle it.Please help me.Thank you very mach.

@jiaruHithub
Copy link
Author

I found a method that to use'dict.setdefault'add a index to self.Index a np.array.
Then I can run thr code with no error

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

1 participant