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: if results['img_prefix'] is not None: #150

Open
imadgohar opened this issue Jul 25, 2024 · 0 comments
Open

KeyError: if results['img_prefix'] is not None: #150

imadgohar opened this issue Jul 25, 2024 · 0 comments

Comments

@imadgohar
Copy link

I am using a custom COCO-type dataset. The classes and everything are updated, and in my log file, it can pick up my dataset and divide it according to the N-way K-shot specs I defined. But at the end, I'm getting this error. What could be the possible reason?

Traceback (most recent call last):
File "tools/detection/train.py", line 236, in
main()
File "tools/detection/train.py", line 225, in main
train_detector(
File "c:\projects\imad-gohar\mmfewshot-main\mmfewshot\detection\apis\train.py", line 206, in train_detector
runner.run(data_loaders, cfg.workflow)
File "C:\Anaconda3\envs\mmfewshot_env\lib\site-packages\mmcv\runner\iter_based_runner.py", line 134, in run
iter_runner(iter_loaders[i], **kwargs)
File "C:\Anaconda3\envs\mmfewshot_env\lib\site-packages\mmcv\runner\iter_based_runner.py", line 59, in train
data_batch = next(data_loader)
File "C:\Anaconda3\envs\mmfewshot_env\lib\site-packages\mmcv\runner\iter_based_runner.py", line 32, in next
data = next(self.iter_loader)
File "c:\projects\imad-gohar\mmfewshot-main\mmfewshot\detection\datasets\dataloader_wrappers.py", line 35, in next
support_data = self.support_iter.next()
File "C:\Anaconda3\envs\mmfewshot_env\lib\site-packages\torch\utils\data\dataloader.py", line 521, in next
data = self._next_data()
File "C:\Anaconda3\envs\mmfewshot_env\lib\site-packages\torch\utils\data\dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "C:\Anaconda3\envs\mmfewshot_env\lib\site-packages\torch\utils\data\dataloader.py", line 1229, in _process_data
data.reraise()
File "C:\Anaconda3\envs\mmfewshot_env\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:\Anaconda3\envs\mmfewshot_env\lib\site-packages\torch\utils\data_utils\worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "C:\Anaconda3\envs\mmfewshot_env\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:\Anaconda3\envs\mmfewshot_env\lib\site-packages\torch\utils\data_utils\fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "c:\projects\imad-gohar\mmfewshot-main\mmfewshot\detection\datasets\dataset_wrappers.py", line 350, in getitem
batch_data = [
File "c:\projects\imad-gohar\mmfewshot-main\mmfewshot\detection\datasets\dataset_wrappers.py", line 351, in
self.support_dataset.prepare_train_img(idx, 'support',
File "c:\projects\imad-gohar\mmfewshot-main\mmfewshot\detection\datasets\base.py", line 328, in prepare_train_img
return self.multi_pipelinespipeline_key
File "C:\Anaconda3\envs\mmfewshot_env\lib\site-packages\mmdet\datasets\pipelines\compose.py", line 41, in call
data = t(data)
File "C:\Anaconda3\envs\mmfewshot_env\lib\site-packages\mmdet\datasets\pipelines\loading.py", line 61, in call
if results['img_prefix'] is not None:
KeyError: 'img_prefix'

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