MILVLG / openvqa

A lightweight, scalable, and general framework for visual question answering research
Apache License 2.0
319 stars 64 forks source link

KeyError issue #81

Open Amajo0209 opened 1 year ago

Amajo0209 commented 1 year ago

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 commented 3 months ago

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 commented 3 months ago

【自动回复】您好,已收到邮件!This is an automatic reply, confirming that your e-mail was received. Thank you!