You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting this error "ValueError: Key img_path is not in available keys."
The error in details:
06/20 02:47:12 - mmengine - WARNING - "FileClient" will be deprecated in future. Please use io functions in https://mmengine.readthedocs.io/en/latest/api/fileio.html#file-io
06/20 02:47:12 - mmengine - WARNING - "HardDiskBackend" is the alias of "LocalBackend" and the former will be deprecated in future.
06/20 02:47:12 - mmengine - INFO - Checkpoints will be saved to /raid/home/dgxuser3/ChanchalBiswas/mmyolo/work_dirs/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance.
/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/albumentations/core/composition.py:144: UserWarning: Got processor for bboxes, but no transform to process it.
self._set_keys()
Traceback (most recent call last):
File "tools/train.py", line 123, in
main()
File "tools/train.py", line 119, in main
runner.train()
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1777, in train
model = self.train_loop.run() # type: ignore
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmengine/runner/loops.py", line 96, in run
self.run_epoch()
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmengine/runner/loops.py", line 112, in run_epoch
for idx, data_batch in enumerate(self.dataloader):
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 410, in getitem
data = self.prepare_data(idx)
File "/raid/home/dgxuser3/ChanchalBiswas/mmyolo/mmyolo/datasets/yolov5_coco.py", line 53, in prepare_data
return self.pipeline(data_info)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 60, in call
data = t(data)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmcv/transforms/base.py", line 12, in call
return self.transform(results)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmdet/structures/bbox/box_type.py", line 267, in wrapper
return func(self, results)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmdet/datasets/transforms/transforms.py", line 1699, in transform
results = self.aug(**results)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/albumentations/core/composition.py", line 255, in call
self._check_args(**data)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/albumentations/core/composition.py", line 324, in _check_args
raise ValueError(msg)
ValueError: Key img_path is not in available keys.
Could you please provide me a solution
Thank you!
Environment
import os
os.system('python mmyolo/utils/collect_env.py')
Result
sys.platform: linux
Python: 3.8.19 (default, Mar 20 2024, 19:58:24) [GCC 11.2.0]
CUDA available: True
MUSA available: False
numpy_random_seed: 2147483648
GPU 0,1,2,3,4,5,6,7: Tesla V100-SXM2-32GB
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 12.4, V12.4.131
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
PyTorch: 1.10.1
PyTorch compiling details: PyTorch built with:
GCC 7.3
C++ Version: 201402
Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303 for Intel(R) 64 architecture applications
Prerequisite
🐞 Describe the bug
I am trying the replicate mmyolo instance segmentation using balloon data set as per the document (https://mmyolo.readthedocs.io/en/latest/get_started/15_minutes_instance_segmentation.html#)
I have followed all the instruction as per the document. After execution
"import os
os.system('python tools/train.py configs/yolov5/ins_seg/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance.py')"
I am getting this error "ValueError: Key img_path is not in available keys."
The error in details:
06/20 02:47:12 - mmengine - WARNING - "FileClient" will be deprecated in future. Please use io functions in https://mmengine.readthedocs.io/en/latest/api/fileio.html#file-io
06/20 02:47:12 - mmengine - WARNING - "HardDiskBackend" is the alias of "LocalBackend" and the former will be deprecated in future.
06/20 02:47:12 - mmengine - INFO - Checkpoints will be saved to /raid/home/dgxuser3/ChanchalBiswas/mmyolo/work_dirs/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance.
/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/albumentations/core/composition.py:144: UserWarning: Got processor for bboxes, but no transform to process it.
self._set_keys()
Traceback (most recent call last):
File "tools/train.py", line 123, in
main()
File "tools/train.py", line 119, in main
runner.train()
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1777, in train
model = self.train_loop.run() # type: ignore
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmengine/runner/loops.py", line 96, in run
self.run_epoch()
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmengine/runner/loops.py", line 112, in run_epoch
for idx, data_batch in enumerate(self.dataloader):
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in next
data = self._next_data()
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
return self._process_data(data)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
data.reraise()
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/_utils.py", line 434, in reraise
raise exception
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
data = fetcher.fetch(index)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 410, in getitem
data = self.prepare_data(idx)
File "/raid/home/dgxuser3/ChanchalBiswas/mmyolo/mmyolo/datasets/yolov5_coco.py", line 53, in prepare_data
return self.pipeline(data_info)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 60, in call
data = t(data)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmcv/transforms/base.py", line 12, in call
return self.transform(results)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmdet/structures/bbox/box_type.py", line 267, in wrapper
return func(self, results)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/mmdet/datasets/transforms/transforms.py", line 1699, in transform
results = self.aug(**results)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/albumentations/core/composition.py", line 255, in call
self._check_args(**data)
File "/home/dgxuser3/anaconda3/envs/mmyolo2/lib/python3.8/site-packages/albumentations/core/composition.py", line 324, in _check_args
raise ValueError(msg)
ValueError: Key img_path is not in available keys.
Could you please provide me a solution
Thank you!
Environment
import os
os.system('python mmyolo/utils/collect_env.py')
Result
sys.platform: linux
Python: 3.8.19 (default, Mar 20 2024, 19:58:24) [GCC 11.2.0]
CUDA available: True
MUSA available: False
numpy_random_seed: 2147483648
GPU 0,1,2,3,4,5,6,7: Tesla V100-SXM2-32GB
CUDA_HOME: /usr/local/cuda
NVCC: Cuda compilation tools, release 12.4, V12.4.131
GCC: gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
PyTorch: 1.10.1
PyTorch compiling details: PyTorch built with:
TorchVision: 0.11.2
OpenCV: 4.10.0
MMEngine: 0.10.4
MMCV: 2.0.1
MMDetection: 3.3.0
MMYOLO: 0.6.0+8c4d9dc
Additional information
Step 1
conda create -n mmyolo2 python=3.8 -y
conda activate mmyolo2
If you have GPU
conda install pytorch torchvision -c pytorch
Step 2
Installed jupyter notebook
conda jupyterlab
Step 3
Open jupyter notebook
Step 4
Clone mmyolo
!git clone https://github.com/open-mmlab/mmyolo.git
!cd mmyolo
pip install -r requirements/albu.txt
!mim install -v -e .
Step 5
Downloaded the data
import os
os.system('python tools/misc/download_dataset.py --dataset-name balloon --save-dir data/balloon --unzip --delete')
Step 6
Converted to coco
import os
os.system('python ./tools/dataset_converters/balloon2coco.py')
Step 7
train yolov5
import os
os.system('python tools/train.py configs/yolov5/ins_seg/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance.py')
Step 8
Change in ins_seg/yolov5_ins_s-v61_syncbn_fast_8xb16-300e_balloon_instance.py
base = './yolov5_ins_s-v61_syncbn_fast_8xb16-300e_coco_instance.py' # noqa
data_root = 'data/balloon/balloon/'
Path of train annotation file
train_ann_file = 'train.json'
train_data_prefix = 'train/' # Prefix of train image path
Path of val annotation file
val_ann_file = 'val.json'
val_data_prefix = 'val/' # Prefix of val image path
metainfo = {
'classes': ('balloon', ),
'palette': [
(220, 20, 60),
]
}
num_classes = 1
train_batch_size_per_gpu = 4
train_num_workers = 2
log_interval = 1
#####################
train_dataloader = dict(
batch_size=train_batch_size_per_gpu,
num_workers=train_num_workers,
dataset=dict(
data_root=data_root,
metainfo=metainfo,
data_prefix=dict(img=train_data_prefix),
ann_file=train_ann_file))
val_dataloader = dict(
dataset=dict(
data_root=data_root,
metainfo=metainfo,
data_prefix=dict(img=val_data_prefix),
ann_file=val_ann_file))
test_dataloader = val_dataloader
val_evaluator = dict(ann_file=data_root + val_ann_file)
test_evaluator = val_evaluator
default_hooks = dict(logger=dict(interval=log_interval))
#####################
model = dict(bbox_head=dict(head_module=dict(num_classes=num_classes)))
The text was updated successfully, but these errors were encountered: