open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.7k stars 9.48k forks source link

Tutorial example failing to run #12035

Open levrone1987 opened 3 weeks ago

levrone1987 commented 3 weeks ago

I tried to run the tutorial from

https://github.com/open-mmlab/mmyolo/blob/main/docs/en/get_started/15_minutes_object_detection.md

and the command

python tools/train.py configs/yolov5/yolov5_s-v61_fast_1xb12-40e_cat.py

Produced the following error:

Traceback (most recent call last):
  File "tools/train.py", line 123, in <module>
    main()
  File "tools/train.py", line 119, in main
    runner.train()
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/mmengine/runner/runner.py", line 1777, in train
    model = self.train_loop.run()  # type: ignore
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/mmengine/runner/loops.py", line 98, in run
    self.run_epoch()
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/mmengine/runner/loops.py", line 114, in run_epoch
    for idx, data_batch in enumerate(self.dataloader):
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 521, in __next__
    data = self._next_data()
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1203, in _next_data
    return self._process_data(data)
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1229, in _process_data
    data.reraise()
  File "/home/mirza/miniconda3/envs/sens-yolo/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/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 287, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/mirza/miniconda3/envs/sens-yolo/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/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 410, in __getitem__
    data = self.prepare_data(idx)
  File "/home/mirza/LAPTOP_sept_2023/sensorz/mmyolo/mmyolo/datasets/yolov5_coco.py", line 53, in prepare_data
    return self.pipeline(data_info)
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/mmengine/dataset/base_dataset.py", line 60, in __call__
    data = t(data)
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/mmcv/transforms/base.py", line 12, in __call__
    return self.transform(results)
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/mmdet/structures/bbox/box_type.py", line 267, in wrapper
    return func(self, results)
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/mmdet/datasets/transforms/transforms.py", line 1699, in transform
    results = self.aug(**results)
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/albumentations/core/composition.py", line 346, in __call__
    self.preprocess(data)
  File "/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/albumentations/core/composition.py", line 373, in preprocess
    raise ValueError(msg)
ValueError: Key img_path is not in available keys.

Here is the output from collect_env:

python mmyolo/utils/collect_env.py
/home/mirza/miniconda3/envs/sens-yolo/lib/python3.8/site-packages/torch/cuda/__init__.py:80: UserWarning: CUDA initialization: CUDA unknown error - this may be due to an incorrectly set up environment, e.g. changing env variable CUDA_VISIBLE_DEVICES after program start. Setting the available devices to be zero. (Triggered internally at  /opt/conda/conda-bld/pytorch_1639180588308/work/c10/cuda/CUDAFunctions.cpp:112.)
  return torch._C._cuda_getDeviceCount() > 0
sys.platform: linux
Python: 3.8.20 (default, Oct  3 2024, 15:24:27) [GCC 11.2.0]
CUDA available: False
MUSA available: False
numpy_random_seed: 2147483648
GCC: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.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
  - Intel(R) MKL-DNN v2.2.3 (Git Hash 7336ca9f055cf1bfa13efb658fe15dc9b41f0740)
  - OpenMP 201511 (a.k.a. OpenMP 4.5)
  - LAPACK is enabled (usually provided by MKL)
  - NNPACK is enabled
  - CPU capability usage: AVX2
  - Build settings: BLAS_INFO=mkl, BUILD_TYPE=Release, CUDA_VERSION=11.3, CUDNN_VERSION=8.2.0, CXX_COMPILER=/opt/rh/devtoolset-7/root/usr/bin/c++, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_KINETO -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DSYMBOLICATE_MOBILE_DEBUG_HANDLE -DEDGE_PROFILER_USE_KINETO -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-unused-local-typedefs -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-psabi -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow, LAPACK_INFO=mkl, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, TORCH_VERSION=1.10.1, USE_CUDA=ON, USE_CUDNN=ON, USE_EXCEPTION_PTR=1, USE_GFLAGS=OFF, USE_GLOG=OFF, USE_MKL=ON, USE_MKLDNN=ON, USE_MPI=OFF, USE_NCCL=ON, USE_NNPACK=ON, USE_OPENMP=ON, 

TorchVision: 0.11.2
OpenCV: 4.10.0
MMEngine: 0.10.5
MMCV: 2.0.1
MMDetection: 3.3.0
MMYOLO: 0.6.0+8c4d9dc