carrierlxk / AGNN

Zero-shot Video Object Segmentation via Attentive Graph Neural Networks (ICCV2019 Oral)
206 stars 25 forks source link

About KeyError #7

Open jiaruHithub opened 4 years ago

jiaruHithub commented 4 years ago

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 commented 4 years ago

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