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

KeyError issue #81

Open
Amajo0209 opened this issue Nov 30, 2022 · 2 comments
Open

KeyError issue #81

Amajo0209 opened this issue Nov 30, 2022 · 2 comments

Comments

@Amajo0209
Copy link

Hi, I am trying to train the mcan model using gqa dataset, and everytime I try to run, I get the following error:

Traceback (most recent call last):
File "run.py", line 162, in
execution.run(__C.RUN_MODE)
File "D:\VQA_docs\openvqa-master\utils\exec.py", line 33, in run
train_engine(self.__C, self.dataset, self.dataset_eval)
File "D:\VQA_docs\openvqa-master\utils\train_engine.py", line 137, in train_engine
for (step,frcn_feat_iter, grid_feat_iter, bbox_feat_iter, ques_ix_iter, ans_iter) in enumerate(dataloader):
File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next
data = self._next_data()
File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 1229, in _process_data
data.reraise()
File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch_utils.py", line 434, in reraise
raise exception
KeyError: Caught KeyError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data_utils\worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "D:\VQA_docs\openvqa-master\openvqa\core\base_dataset.py", line 36, in getitem
frcn_feat_iter, grid_feat_iter, bbox_feat_iter = self.load_img_feats(idx, iid)
File "D:\VQA_docs\openvqa-master\openvqa\datasets\gqa\gqa_loader.py", line 204, in load_img_feats
frcn_feat = np.load(self.iid_to_frcn_feat_path[iid])
KeyError: '2363772'

I was getting some other errors before this one, and I got to solve them. however, the only issue I am struggling with now is this one. DOES ANYONE KNOW HOW I CAN FIX THIS?

@LSC200107
Copy link

Hi, I am trying to train the mcan model using gqa dataset, and everytime I try to run, I get the following error:

Traceback (most recent call last): File "run.py", line 162, in execution.run(__C.RUN_MODE) File "D:\VQA_docs\openvqa-master\utils\exec.py", line 33, in run train_engine(self.__C, self.dataset, self.dataset_eval) File "D:\VQA_docs\openvqa-master\utils\train_engine.py", line 137, in train_engine for (step,frcn_feat_iter, grid_feat_iter, bbox_feat_iter, ques_ix_iter, ans_iter) in enumerate(dataloader): File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next data = self._next_data() File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 1203, in _next_data return self._process_data(data) File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py", line 1229, in _process_data data.reraise() File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch_utils.py", line 434, in reraise raise exception KeyError: Caught KeyError in DataLoader worker process 0. Original Traceback (most recent call last): File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data_utils\worker.py", line 287, in _worker_loop data = fetcher.fetch(index) File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "C:\Users\PC\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in data = [self.dataset[idx] for idx in possibly_batched_index] File "D:\VQA_docs\openvqa-master\openvqa\core\base_dataset.py", line 36, in getitem frcn_feat_iter, grid_feat_iter, bbox_feat_iter = self.load_img_feats(idx, iid) File "D:\VQA_docs\openvqa-master\openvqa\datasets\gqa\gqa_loader.py", line 204, in load_img_feats frcn_feat = np.load(self.iid_to_frcn_feat_path[iid]) KeyError: '2363772'

I was getting some other errors before this one, and I got to solve them. however, the only issue I am struggling with now is this one. DOES ANYONE KNOW HOW I CAN FIX THIS?

Hello, have you solved this problem?I encountered the same problem.

@J-Luuu
Copy link

J-Luuu commented Jun 26, 2024 via email

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