BBox conversion error to coco format.
See original GitHub issueInstructions To Reproduce the 🐛 Bug:
- Full runnable code or full changes you made:
If making changes to the project itself, please use output of the following command:
git rev-parse HEAD; git diff
<put code or diff here>z
```zz
2. What exact command you run:
3. __Full logs__ or other relevant observations:
<put logs here>
```zzz
4. please simplify the steps as much as possible so they do not require additional resources to
run, such as a private dataset.
Expected behavior:
zzz If there are no obvious error in “what you observed” provided above, please tell us the expected behavior.
Environment:
Provide your environment information using the following command: zzz
wget -nc -q https://github.com/facebookresearch/detectron2/raw/master/detectron2/utils/collect_env.py && python collect_env.py
sys.platform linux Python 3.6.10 |Anaconda, Inc.| (default, Jan 7 2020, 21:14:29) [GCC 7.3.0] numpy 1.18.1 detectron2 0.4 @/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/detectron2 Compiler GCC 7.3 CUDA compiler CUDA 10.1 detectron2 arch flags 7.0 DETECTRON2_ENV_MODULE PyTorch 1.7.0 @/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/torch PyTorch debug build True GPU available True GPU 0 Tesla V100-SXM2-16GB (arch=7.0) CUDA_HOME /usr/local/cuda-10.1 Pillow 8.0.1 torchvision 0.8.1 @/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/torchvision torchvision arch flags 3.5, 5.0, 6.0, 7.0, 7.5 fvcore 0.1.3.post20210317 cv2 4.5.1
PyTorch built with:
GCC 7.3 C++ Version: 201402 Intel® Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel® 64 architecture applications Intel® MKL-DNN v1.6.0 (Git Hash 5ef631a030a6f73131c77892041042805a06064f) OpenMP 201511 (a.k.a. OpenMP 4.5) NNPACK is enabled CPU capability usage: AVX2 CUDA Runtime 10.1 NVCC architecture flags: -gencode;arch=compute_37,code=sm_37;-gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_37,code=compute_37 CuDNN 7.6.3 Magma 2.5.2 Build settings: BLAS=MKL, BUILD_TYPE=Release, CXX_FLAGS= -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -fopenmp -DNDEBUG -DUSE_FBGEMM -DUSE_QNNPACK -DUSE_PYTORCH_QNNPACK -DUSE_XNNPACK -DUSE_VULKAN_WRAPPER -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, PERF_WITH_AVX=1, PERF_WITH_AVX2=1, PERF_WITH_AVX512=1, USE_CUDA=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, TEST: AUG: ENABLED: False FLIP: True MAX_SIZE: 4000 MIN_SIZES: (400, 500, 600, 700, 800, 900, 1000, 1100, 1200) DETECTIONS_PER_IMAGE: 100 EVAL_PERIOD: 0 EXPECTED_RESULTS: [] KEYPOINT_OKS_SIGMAS: [] PRECISE_BN: ENABLED: False NUM_ITER: 200 VERSION: 2 VIS_PERIOD: 0 VIS_THRESH: 0.3
[03/23 23:59:52 d2.data.dataset_mapper]: [DatasetMapper] Augmentations used in inference: [ResizeShortestEdge(short_edge_length=(800, 800), max_size=1333, sample_style=‘choice’)] [03/23 23:59:52 d2.data.common]: Serializing 598 elements to byte tensors and concatenating them all … [03/23 23:59:52 d2.data.common]: Serialized dataset takes 1.48 MiB WARNING [03/23 23:59:52 d2.evaluation.coco_evaluation]: COCO Evaluator instantiated using config, this is deprecated behavior. Please pass in explicit arguments instead. [03/23 23:59:52 d2.evaluation.coco_evaluation]: ‘val_ds7’ is not registered by register_coco_instances. Therefore trying to convert it to COCO format … [03/23 23:59:52 d2.data.datasets.coco]: Converting annotations of dataset ‘val_ds7’ to COCO format …) [03/24 00:00:36 d2.data.datasets.coco]: Converting dataset dicts into COCO format Traceback (most recent call last): File “train_net.py”, line 247, in args=(args,), File “/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/detectron2/engine/launch.py”, line 62, in launch main_func(*args) File “train_net.py”, line 212, in main return do_test(cfg, model) File “train_net.py”, line 57, in do_test evaluator = COCOEvaluator(dataset_name, cfg, True, output_folder) File “/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/detectron2/evaluation/coco_evaluation.py”, line 111, in init convert_to_coco_json(dataset_name, cache_path) File “/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/detectron2/data/datasets/coco.py”, line 459, in convert_to_coco_json coco_dict = convert_to_coco_dict(dataset_name) File “/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/detectron2/data/datasets/coco.py”, line 358, in convert_to_coco_dict bbox = BoxMode.convert(bbox, from_bbox_mode, to_bbox_mode) File “/home/ec2-user/anaconda3/envs/pytorch_latest_p36/lib/python3.6/site-packages/detectron2/structures/boxes.py”, line 123, in convert arr[:, 2] -= arr[:, 0] IndexError: too many indices for tensor of dimension 1
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (2 by maintainers)
Top GitHub Comments
So it is true that your data does not follow the format documented in https://detectron2.readthedocs.io/en/latest/tutorials/datasets.html.
Though it makes sense to add support for it in
BoxMode.convert
yes, I assumed list and arrays would be handled but only list is supported as of now …