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

ValueError: not enough values to unpack (expected 3, got 0) YOLOv5_obb #12942

Open
yasmine-lkl opened this issue Apr 18, 2024 · 11 comments
Open

Comments

@yasmine-lkl
Copy link

Hello, I'm currently attempting to train my data on Google Colab using YOLOv5 with oriented bounding boxes (YOLOv5 OBB). I annotated my images on CVAT with corrected orientations. However, when using only YOLOv5, the bounding boxes are horizontal, whereas I require them to be in the correct orientation. To address this, I uploaded my images and their annotations to Roboflow and exported them using YOLOv5 Oriented Bounding Boxes. I followed the tutorial provided at https://blog.roboflow.com/yolov5-for-oriented-object-detection/, but I encountered the following error. (All the data I'm using has been uploaded to Roboflow, as mentioned earlier, so my annotations should be in the correct format).

/content/yolov5_obb
2024-04-18 13:52:34.956689: E external/local_xla/xla/stream_executor/cuda/cuda_dnn.cc:9261] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
2024-04-18 13:52:34.956736: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:607] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
2024-04-18 13:52:34.958590: E external/local_xla/xla/stream_executor/cuda/cuda_blas.cc:1515] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
2024-04-18 13:52:36.030586: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT
train: weights=weights/yolov5n.pt, cfg=, data=/content/datasets/roboflow/data.yaml, hyp=data/hyps/obb/hyp.finetune_dota.yaml, epochs=10, batch_size=1, imgsz=1024, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, evolve=None, bucket=, cache=None, image_weights=False, device=0, multi_scale=False, single_cls=False, adam=False, sync_bn=False, workers=8, project=runs/train, name=exp, exist_ok=True, quad=False, linear_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest
github: up to date with https://github.com/hukaixuan19970627/yolov5_obb
YOLOv5 🚀 b00c3f2 torch 2.2.1+cu121 CUDA:0 (NVIDIA A100-SXM4-40GB, 40514MiB)

hyperparameters: lr0=0.01, lrf=0.2, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, theta=0.5, theta_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=180.0, translate=0.1, scale=0.25, shear=0.0, perspective=0.0, flipud=0.5, fliplr=0.5, mosaic=0.75, mixup=0.1, copy_paste=0.0, cls_theta=180, csl_radius=2.0
Weights & Biases: run 'pip install wandb' to automatically track and visualize YOLOv5 🚀 runs (RECOMMENDED)
TensorBoard: Start with 'tensorboard --logdir runs/train', view at http://localhost:6006/
Downloading https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5n.pt to weights/yolov5n.pt...
100% 3.87M/3.87M [00:00<00:00, 151MB/s]

Overriding model.yaml nc=80 with nc=4

             from  n    params  module                                  arguments                     

0 -1 1 1760 models.common.Conv [3, 16, 6, 2, 2]
1 -1 1 4672 models.common.Conv [16, 32, 3, 2]
2 -1 1 4800 models.common.C3 [32, 32, 1]
3 -1 1 18560 models.common.Conv [32, 64, 3, 2]
4 -1 2 29184 models.common.C3 [64, 64, 2]
5 -1 1 73984 models.common.Conv [64, 128, 3, 2]
6 -1 3 156928 models.common.C3 [128, 128, 3]
7 -1 1 295424 models.common.Conv [128, 256, 3, 2]
8 -1 1 296448 models.common.C3 [256, 256, 1]
9 -1 1 164608 models.common.SPPF [256, 256, 5]
10 -1 1 33024 models.common.Conv [256, 128, 1, 1]
11 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
12 [-1, 6] 1 0 models.common.Concat [1]
13 -1 1 90880 models.common.C3 [256, 128, 1, False]
14 -1 1 8320 models.common.Conv [128, 64, 1, 1]
15 -1 1 0 torch.nn.modules.upsampling.Upsample [None, 2, 'nearest']
16 [-1, 4] 1 0 models.common.Concat [1]
17 -1 1 22912 models.common.C3 [128, 64, 1, False]
18 -1 1 36992 models.common.Conv [64, 64, 3, 2]
19 [-1, 14] 1 0 models.common.Concat [1]
20 -1 1 74496 models.common.C3 [128, 128, 1, False]
21 -1 1 147712 models.common.Conv [128, 128, 3, 2]
22 [-1, 10] 1 0 models.common.Concat [1]
23 -1 1 296448 models.common.C3 [256, 256, 1, False]
24 [17, 20, 23] 1 255717 models.yolo.Detect [4, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [64, 128, 256]]
Model Summary: 270 layers, 2012869 parameters, 2012869 gradients, 5.0 GFLOPs

Transferred 343/349 items from weights/yolov5n.pt
Scaled weight_decay = 0.0005
optimizer: SGD with parameter groups 57 weight, 60 weight (no decay), 60 bias
albumentations: Blur(always_apply=False, p=0.01, blur_limit=(3, 7)), MedianBlur(always_apply=False, p=0.01, blur_limit=(3, 7)), ToGray(always_apply=False, p=0.01), CLAHE(always_apply=False, p=0.01, clip_limit=(1, 4.0), tile_grid_size=(8, 8))
/usr/lib/python3.10/multiprocessing/popen_fork.py:66: RuntimeWarning: os.fork() was called. os.fork() is incompatible with multithreaded code, and JAX is multithreaded, so this will likely lead to a deadlock.
self.pid = os.fork()
train: Scanning '../datasets/roboflow/train/labelTxt' images and labels...66 found, 0 missing, 0 empty, 66 corrupted: 100% 66/66 [00:00<00:00, 3156.85it/s]
train: WARNING: ../datasets/roboflow/train/images/101_0080_0032_JPG.rf.acaf4287508e8d1650330bb3493a5cd0.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0075_JPG.rf.c3225df3710f0cdb6781510677712ab6.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0077_JPG.rf.edeff5715e98386e970cb851785732d0.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0079_JPG.rf.3f5e3abcba00c3137f09d9a8157a9ce3.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0080_JPG.rf.2ea1352d02087a8940d010a00a7b63bc.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0085_JPG.rf.c9759d24aac28ee3b8674b63e3c31330.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0091_JPG.rf.01e5324a8466aebebc78f8e68fb81d4e.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0093_JPG.rf.f2869c04875e6ac37b09c40f6e7ce991.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0096_JPG.rf.a0ddf088c6f46c55c197aa9aa78af018.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0097_JPG.rf.722bccf6874b4af1ccc3ed94e7493a30.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0100_JPG.rf.794fd877c85e962596ab497704c0d111.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0080_0101_JPG.rf.6fb84dd979858d52cdfcd17427388662.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0004_JPG.rf.d862fa1ce430fecf1d9debcbeb545fe4.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0009_JPG.rf.dfd9912d103379ed981fed3e06ad3a51.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0023_JPG.rf.433a0c589e05079a91ea29ae7538e3be.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0028_JPG.rf.f9c6bde2b29627fca3ab55bdd7ac76c6.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0029_JPG.rf.6be501c7ec4cbf3331d698a82f98539c.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0030_JPG.rf.38fcea35bf23d8e5c8baf8beeb38d7e8.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0031_JPG.rf.1e7d66efb0c453fb0b3e7a5a37da3156.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0041_JPG.rf.8d70d52eabd4003e637f601d15b90773.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0048_JPG.rf.f12249276f697f1f7ab9a89f4441e78d.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0054_JPG.rf.64f6afd355a3d390e0e601d48b251f07.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0056_JPG.rf.024e0a9566a694d12d5df24e1831df4f.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0060_JPG.rf.a021e36a66c062fd922254bad3ec7239.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0061_JPG.rf.d309384f424b3b6df1683bf0f52261a3.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0065_JPG.rf.ac8c4e5a082b21163002a5fae9043bdb.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0076_JPG.rf.5b94beed18295525e53f8e9379a339f4.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0089_JPG.rf.f0e4679985c658cbd2661378016ec303.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0093_JPG.rf.956288ae5c025d681f36bcf95a69536e.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0094_JPG.rf.0a049e4a3a314eacc3c16e9b867b3733.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0081_0099_JPG.rf.b3d4970f431e86fc703c28d277de04b5.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0128_0004_JPG.rf.df403e0e6048ac3397400af13e43ab43.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0128_0006_JPG.rf.02eba7ddb8f0a0fa35bb0fefd2b0d7b0.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0128_0013_JPG.rf.71e5b945e6685f6e846e5c53aef9996b.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0128_0018_JPG.rf.9b13f0402ab39bb282ba6e9cdc3cb0e0.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0128_0033_JPG.rf.2672b343c2a0d5abe0cfc27e56b12478.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0128_0036_JPG.rf.b56497ead353995643cf708b9b1ce524.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0128_0037_JPG.rf.03fd7f6b97f6548070362ce9d227751e.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0128_0048_JPG.rf.307acc098f47413dad4de3e32f20d083.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0002_JPG.rf.410c871e3a49680f3891ae172f2bcc05.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0005_JPG.rf.31fb7367673f884c7b48001a1759ae9d.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0008_JPG.rf.8cce59520cba1e17a02ff22c23898fb4.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0010_JPG.rf.87f83bfe330d3f2f7c74cf16172acebc.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0013_JPG.rf.e1aa7907bedfdb1157c05d91f54858f7.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0024_JPG.rf.a06724e040fbd707c2b83f1f5b98a731.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0028_JPG.rf.b70fc5321e3c7df40636650d1fced395.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0032_JPG.rf.a08578f6ad045cc24df943e753813737.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0040_JPG.rf.84aef3583901a159295d8df160dd9500.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0042_JPG.rf.033b57c212c56685372452a66d65dd46.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0043_JPG.rf.527aa04bd9201b0bdd53398f983410ac.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0044_JPG.rf.8410683b8ab60731c39be7eb78c4b163.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0047_JPG.rf.7ad574812fbb591b2f102effb5d694fe.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/101_0129_0048_JPG.rf.9bf8570e92f3423ed07156f830cd0f27.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/Boetie_png.rf.94653ffe15c836d7e39c8ac3a474f8d1.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/Chauchat_png.rf.6c5124cc9ea1b3685908d3f81fb1a8af.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/D37103-C102827-MONTPARNASSE_png.rf.908a345ea001b7f4160b08ea3003e248.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/D42495_APHP_CC49_png.rf.f96732d988d50c04335f240da40bb0b0.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/DOMINIQUE_png.rf.ea4adb5fff7f252e1cf8d0b1d20aff3a.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/FOCH_png.rf.cc078cf1e5c525c89d6cedf47891e997.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/FRIEDLAND-CC49_png.rf.d1c3e3aadd774a697071cba8c5a18c0f.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/LAVOISIER-CC49_png.rf.4b6337a3aad9da858a48067bca712185.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/ORTHOPHOTO_png.rf.7ed33c133c1caabec30bcf982495da03.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/REAUMUR_png.rf.b58441e40b39674c789800ca919badf5.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/TOITURE_png.rf.0eee8d2cb5b73ac00a06033e4ef43199.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/Toiture_Malakoff_png.rf.72bbe070f92a0183f1a8c2c4b114269b.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: WARNING: ../datasets/roboflow/train/images/Toiture_rue_pavee_png.rf.71ea53d3bec0983834c574eef71e765a.jpg: ignoring corrupt image/label: The DType <class 'numpy._IntegerAbstractDType'> could not be promoted by <class 'numpy.dtypes.StrDType'>. This means that no common DType exists for the given inputs. For example they cannot be stored in a single array unless the dtype is object. The full list of DTypes is: (<class 'numpy._IntegerAbstractDType'>, <class 'numpy.dtypes.StrDType'>)
train: New cache created: ../datasets/roboflow/train/labelTxt.cache
Traceback (most recent call last):
File "/content/yolov5_obb/train.py", line 633, in
main(opt)
File "/content/yolov5_obb/train.py", line 530, in main
train(opt.hyp, opt, device, callbacks)
File "/content/yolov5_obb/train.py", line 213, in train
train_loader, dataset = create_dataloader(train_path, imgsz, batch_size // WORLD_SIZE, gs, names, single_cls,
File "/content/yolov5_obb/utils/datasets.py", line 101, in create_dataloader
dataset = LoadImagesAndLabels(path, names, imgsz, batch_size,
File "/content/yolov5_obb/utils/datasets.py", line 444, in init
labels, shapes, self.segments = zip(*cache.values())
ValueError: not enough values to unpack (expected 3, got 0)

Copy link
Contributor

👋 Hello @yasmine-lkl, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Requirements

Python>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Introducing YOLOv8 🚀

We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀!

Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.

Check out our YOLOv8 Docs for details and get started with:

pip install ultralytics

@glenn-jocher
Copy link
Member

Hello! It looks like you're encountering an issue where your dataset might not be properly formatted or recognized by the YOLOv5 OBB (oriented bounding boxes) training process. This specific error typically arises when the training script fails to load any annotations from your dataset, possibly due to incompatible or corrupt files.

Here's a quick checklist to help resolve the issue:

  1. Verify Annotation Format: Ensure your annotations are correctly formatted for YOLOv5 OBB. The error suggests the training script can't find or interpret your annotation files.
  2. Check for Corrupt Files: The warnings about ignoring corrupt images/labels indicate some files might not be processed correctly. Double-check these files to ensure they're not corrupt or improperly formatted.
  3. Path Check: Verify the paths to your dataset and annotation files are correct. The dataset should be structured and referenced according to the YOLOv5 documentation.
  4. Review Dataset: Examine a few annotation files manually to ensure they are not empty and follow the expected structure.

Given the error message:

labels, shapes, the segments = zip(*cache.values())
ValueError: not enough values to unpack (expected 3, got 0)

This implies the cache.values() call returned an empty iterator, which can happen if the dataset loading process doesn't find any valid annotation files to load.

If after these steps you're still facing issues, consider revisiting the dataset preparation stage, ensuring that your data is exported in a compatible format for YOLOv5 OBB training. Also, consult the documentation available at the official GitHub repository and repositories providing OBB support for additional guidance on data preparation and troubleshooting.

I hope this helps! If you have more details or other errors come up, feel free to share them for more specific advice. 🙂

@yasmine-lkl
Copy link
Author

yasmine-lkl commented Apr 19, 2024

I've verified all these points but still don't know where the problem is (I'm not sure if this detail is important, but I commented out the line 'from . import nms_rotated_ext' in nms_rotated_wrapper.py because the script was throwing an error before I commented it out.). You can find my annotations (of train) in the .txt file attached. My data is organized like this :
image

101_0080_0032_JPG.rf.acaf4287508e8d1650330bb3493a5cd0.txt
101_0080_0075_JPG.rf.c3225df3710f0cdb6781510677712ab6.txt
101_0080_0077_JPG.rf.edeff5715e98386e970cb851785732d0.txt
101_0080_0079_JPG.rf.3f5e3abcba00c3137f09d9a8157a9ce3.txt
101_0080_0080_JPG.rf.2ea1352d02087a8940d010a00a7b63bc.txt
101_0080_0085_JPG.rf.c9759d24aac28ee3b8674b63e3c31330.txt
101_0080_0091_JPG.rf.01e5324a8466aebebc78f8e68fb81d4e.txt
101_0080_0093_JPG.rf.f2869c04875e6ac37b09c40f6e7ce991.txt
101_0080_0096_JPG.rf.a0ddf088c6f46c55c197aa9aa78af018.txt
101_0080_0097_JPG.rf.722bccf6874b4af1ccc3ed94e7493a30.txt
101_0080_0100_JPG.rf.794fd877c85e962596ab497704c0d111.txt
101_0080_0101_JPG.rf.6fb84dd979858d52cdfcd17427388662.txt
101_0081_0004_JPG.rf.d862fa1ce430fecf1d9debcbeb545fe4.txt
101_0081_0009_JPG.rf.dfd9912d103379ed981fed3e06ad3a51.txt
101_0081_0023_JPG.rf.433a0c589e05079a91ea29ae7538e3be.txt
101_0081_0028_JPG.rf.f9c6bde2b29627fca3ab55bdd7ac76c6.txt
101_0081_0029_JPG.rf.6be501c7ec4cbf3331d698a82f98539c.txt
101_0081_0030_JPG.rf.38fcea35bf23d8e5c8baf8beeb38d7e8.txt
101_0081_0031_JPG.rf.1e7d66efb0c453fb0b3e7a5a37da3156.txt
101_0081_0041_JPG.rf.8d70d52eabd4003e637f601d15b90773.txt
101_0081_0048_JPG.rf.f12249276f697f1f7ab9a89f4441e78d.txt
101_0081_0054_JPG.rf.64f6afd355a3d390e0e601d48b251f07.txt
101_0081_0056_JPG.rf.024e0a9566a694d12d5df24e1831df4f.txt
101_0081_0060_JPG.rf.a021e36a66c062fd922254bad3ec7239.txt
101_0081_0061_JPG.rf.d309384f424b3b6df1683bf0f52261a3.txt
101_0081_0065_JPG.rf.ac8c4e5a082b21163002a5fae9043bdb.txt
101_0081_0076_JPG.rf.5b94beed18295525e53f8e9379a339f4.txt
101_0081_0089_JPG.rf.f0e4679985c658cbd2661378016ec303.txt
101_0081_0093_JPG.rf.956288ae5c025d681f36bcf95a69536e.txt
101_0081_0094_JPG.rf.0a049e4a3a314eacc3c16e9b867b3733.txt
101_0081_0099_JPG.rf.b3d4970f431e86fc703c28d277de04b5.txt
101_0128_0004_JPG.rf.df403e0e6048ac3397400af13e43ab43.txt
101_0128_0006_JPG.rf.02eba7ddb8f0a0fa35bb0fefd2b0d7b0.txt
101_0128_0013_JPG.rf.71e5b945e6685f6e846e5c53aef9996b.txt
101_0128_0018_JPG.rf.9b13f0402ab39bb282ba6e9cdc3cb0e0.txt
101_0128_0033_JPG.rf.2672b343c2a0d5abe0cfc27e56b12478.txt
101_0128_0036_JPG.rf.b56497ead353995643cf708b9b1ce524.txt
101_0128_0037_JPG.rf.03fd7f6b97f6548070362ce9d227751e.txt
101_0128_0048_JPG.rf.307acc098f47413dad4de3e32f20d083.txt
101_0129_0002_JPG.rf.410c871e3a49680f3891ae172f2bcc05.txt
101_0129_0005_JPG.rf.31fb7367673f884c7b48001a1759ae9d.txt
101_0129_0008_JPG.rf.8cce59520cba1e17a02ff22c23898fb4.txt
101_0129_0010_JPG.rf.87f83bfe330d3f2f7c74cf16172acebc.txt
101_0129_0013_JPG.rf.e1aa7907bedfdb1157c05d91f54858f7.txt
101_0129_0024_JPG.rf.a06724e040fbd707c2b83f1f5b98a731.txt
101_0129_0028_JPG.rf.b70fc5321e3c7df40636650d1fced395.txt
101_0129_0032_JPG.rf.a08578f6ad045cc24df943e753813737.txt
101_0129_0040_JPG.rf.84aef3583901a159295d8df160dd9500.txt
101_0129_0042_JPG.rf.033b57c212c56685372452a66d65dd46.txt
101_0129_0043_JPG.rf.527aa04bd9201b0bdd53398f983410ac.txt
101_0129_0044_JPG.rf.8410683b8ab60731c39be7eb78c4b163.txt
101_0129_0047_JPG.rf.7ad574812fbb591b2f102effb5d694fe.txt
101_0129_0048_JPG.rf.9bf8570e92f3423ed07156f830cd0f27.txt

@yasmine-lkl
Copy link
Author

yasmine-lkl commented Apr 19, 2024

I've verified all these points but still don't know where the problem is (I'm not sure if this detail is important, but I commented out the line 'from . import nms_rotated_ext' in nms_rotated_wrapper.py because the script was throwing an error before I commented it out.). You can find my annotations (of train) in the .txt file attached. My data is organized like this : image

101_0080_0032_JPG.rf.acaf4287508e8d1650330bb3493a5cd0.txt 101_0080_0075_JPG.rf.c3225df3710f0cdb6781510677712ab6.txt 101_0080_0077_JPG.rf.edeff5715e98386e970cb851785732d0.txt 101_0080_0079_JPG.rf.3f5e3abcba00c3137f09d9a8157a9ce3.txt 101_0080_0080_JPG.rf.2ea1352d02087a8940d010a00a7b63bc.txt 101_0080_0085_JPG.rf.c9759d24aac28ee3b8674b63e3c31330.txt 101_0080_0091_JPG.rf.01e5324a8466aebebc78f8e68fb81d4e.txt 101_0080_0093_JPG.rf.f2869c04875e6ac37b09c40f6e7ce991.txt 101_0080_0096_JPG.rf.a0ddf088c6f46c55c197aa9aa78af018.txt 101_0080_0097_JPG.rf.722bccf6874b4af1ccc3ed94e7493a30.txt 101_0080_0100_JPG.rf.794fd877c85e962596ab497704c0d111.txt 101_0080_0101_JPG.rf.6fb84dd979858d52cdfcd17427388662.txt 101_0081_0004_JPG.rf.d862fa1ce430fecf1d9debcbeb545fe4.txt 101_0081_0009_JPG.rf.dfd9912d103379ed981fed3e06ad3a51.txt 101_0081_0023_JPG.rf.433a0c589e05079a91ea29ae7538e3be.txt 101_0081_0028_JPG.rf.f9c6bde2b29627fca3ab55bdd7ac76c6.txt 101_0081_0029_JPG.rf.6be501c7ec4cbf3331d698a82f98539c.txt 101_0081_0030_JPG.rf.38fcea35bf23d8e5c8baf8beeb38d7e8.txt 101_0081_0031_JPG.rf.1e7d66efb0c453fb0b3e7a5a37da3156.txt 101_0081_0041_JPG.rf.8d70d52eabd4003e637f601d15b90773.txt 101_0081_0048_JPG.rf.f12249276f697f1f7ab9a89f4441e78d.txt 101_0081_0054_JPG.rf.64f6afd355a3d390e0e601d48b251f07.txt 101_0081_0056_JPG.rf.024e0a9566a694d12d5df24e1831df4f.txt 101_0081_0060_JPG.rf.a021e36a66c062fd922254bad3ec7239.txt 101_0081_0061_JPG.rf.d309384f424b3b6df1683bf0f52261a3.txt 101_0081_0065_JPG.rf.ac8c4e5a082b21163002a5fae9043bdb.txt 101_0081_0076_JPG.rf.5b94beed18295525e53f8e9379a339f4.txt 101_0081_0089_JPG.rf.f0e4679985c658cbd2661378016ec303.txt 101_0081_0093_JPG.rf.956288ae5c025d681f36bcf95a69536e.txt 101_0081_0094_JPG.rf.0a049e4a3a314eacc3c16e9b867b3733.txt 101_0081_0099_JPG.rf.b3d4970f431e86fc703c28d277de04b5.txt 101_0128_0004_JPG.rf.df403e0e6048ac3397400af13e43ab43.txt 101_0128_0006_JPG.rf.02eba7ddb8f0a0fa35bb0fefd2b0d7b0.txt 101_0128_0013_JPG.rf.71e5b945e6685f6e846e5c53aef9996b.txt 101_0128_0018_JPG.rf.9b13f0402ab39bb282ba6e9cdc3cb0e0.txt 101_0128_0033_JPG.rf.2672b343c2a0d5abe0cfc27e56b12478.txt 101_0128_0036_JPG.rf.b56497ead353995643cf708b9b1ce524.txt 101_0128_0037_JPG.rf.03fd7f6b97f6548070362ce9d227751e.txt 101_0128_0048_JPG.rf.307acc098f47413dad4de3e32f20d083.txt 101_0129_0002_JPG.rf.410c871e3a49680f3891ae172f2bcc05.txt 101_0129_0005_JPG.rf.31fb7367673f884c7b48001a1759ae9d.txt 101_0129_0008_JPG.rf.8cce59520cba1e17a02ff22c23898fb4.txt 101_0129_0010_JPG.rf.87f83bfe330d3f2f7c74cf16172acebc.txt 101_0129_0013_JPG.rf.e1aa7907bedfdb1157c05d91f54858f7.txt 101_0129_0024_JPG.rf.a06724e040fbd707c2b83f1f5b98a731.txt 101_0129_0028_JPG.rf.b70fc5321e3c7df40636650d1fced395.txt 101_0129_0032_JPG.rf.a08578f6ad045cc24df943e753813737.txt 101_0129_0040_JPG.rf.84aef3583901a159295d8df160dd9500.txt 101_0129_0042_JPG.rf.033b57c212c56685372452a66d65dd46.txt 101_0129_0043_JPG.rf.527aa04bd9201b0bdd53398f983410ac.txt 101_0129_0044_JPG.rf.8410683b8ab60731c39be7eb78c4b163.txt 101_0129_0047_JPG.rf.7ad574812fbb591b2f102effb5d694fe.txt 101_0129_0048_JPG.rf.9bf8570e92f3423ed07156f830cd0f27.txt

@glenn-jocher
Copy link
Member

It seems like the issue might still be related to how the annotations or the dataset are handled in your setup. Commenting out from . import nms_rotated_ext in nms_rotated_wrapper.py could potentially skip necessary steps for processing oriented bounding boxes, leading to unexpected errors downstream.

Given that you've checked the format and paths without resolution, it might be insightful to ensure the environment setup, particularly around the NMS (Non-Maximum Suppression) for rotated bounding boxes, is correctly configured as per the requirements for YOLOv5 OBB.

If the script was throwing errors related to nms_rotated_ext, it might indicate a problem with compiling custom C++/CUDA extensions required for rotated bounding boxes. This could be due to a variety of environment-specific issues such as missing compiler tools or incompatible CUDA/pytorch versions.

Since direct modification of the codebase can introduce hard-to-track issues, I recommend:

  • Reverting any manual changes.
  • Ensuring your environment meets all the compile-time requirements (e.g., CUDA and compiler versions).
  • Running installation or setup commands as specified in the documentation or repo instructions to ensure all necessary dependencies and custom extensions are correctly installed and compiled.

If after addressing these points the problem persists, sharing the specific error message related to nms_rotated_ext might help pinpoint the issue further. It could also be beneficial to check if there are any open issues or updates in the repository that address similar problems with oriented bounding boxes.

Hope this helps guide you towards a resolution! 🚀

@yasmine-lkl
Copy link
Author

yasmine-lkl commented May 6, 2024

It seems like the issue might still be related to how the annotations or the dataset are handled in your setup. Commenting out from . import nms_rotated_ext in nms_rotated_wrapper.py could potentially skip necessary steps for processing oriented bounding boxes, leading to unexpected errors downstream.

Given that you've checked the format and paths without resolution, it might be insightful to ensure the environment setup, particularly around the NMS (Non-Maximum Suppression) for rotated bounding boxes, is correctly configured as per the requirements for YOLOv5 OBB.

If the script was throwing errors related to nms_rotated_ext, it might indicate a problem with compiling custom C++/CUDA extensions required for rotated bounding boxes. This could be due to a variety of environment-specific issues such as missing compiler tools or incompatible CUDA/pytorch versions.

Since direct modification of the codebase can introduce hard-to-track issues, I recommend:

  • Reverting any manual changes.
  • Ensuring your environment meets all the compile-time requirements (e.g., CUDA and compiler versions).
  • Running installation or setup commands as specified in the documentation or repo instructions to ensure all necessary dependencies and custom extensions are correctly installed and compiled.

If after addressing these points the problem persists, sharing the specific error message related to nms_rotated_ext might help pinpoint the issue further. It could also be beneficial to check if there are any open issues or updates in the repository that address similar problems with oriented bounding boxes.

Hope this helps guide you towards a resolution! 🚀

Thank you very much for your detailed response! Indeed, I tried uncommenting the line "from . import nms_rotated_ext" as suggested, but it led to the exact error :

/content/yolov5_obb
Traceback (most recent call last):
File "/content/yolov5_obb/train.py", line 34, in
import val # for end-of-epoch mAP
File "/content/yolov5_obb/val.py", line 28, in
from models.common import DetectMultiBackend
File "/content/yolov5_obb/models/common.py", line 23, in
from utils.datasets import exif_transpose, letterbox
File "/content/yolov5_obb/utils/datasets.py", line 28, in
from utils.augmentations import Albumentations, augment_hsv, copy_paste, letterbox, mixup, random_perspective
File "/content/yolov5_obb/utils/augmentations.py", line 12, in
from utils.general import LOGGER, check_version, colorstr, resample_segments, segment2box
File "/content/yolov5_obb/utils/general.py", line 35, in
from utils.nms_rotated import obb_nms
File "/content/yolov5_obb/utils/nms_rotated/init.py", line 1, in
from .nms_rotated_wrapper import obb_nms, poly_nms
File "/content/yolov5_obb/utils/nms_rotated/nms_rotated_wrapper.py", line 4, in
from . import nms_rotated_ext
ImportError: cannot import name 'nms_rotated_ext' from partially initialized module 'utils.nms_rotated' (most likely due to a circular import) (/content/yolov5_obb/utils/nms_rotated/init.py)

image

@glenn-jocher
Copy link
Member

Thanks for sharing the specific error message! It looks like there might be a circular import or a problem with compiling the nms_rotated_ext. Here are a few suggestions:

  1. Circular Imports: Ensure that there are no circular imports in your code. Check the import statements in your .py files to make sure that modules are not mutually importing each other in a way that could cause such issues.

  2. Compiling Extensions: Verify that the C++/CUDA extensions required for nms_rotated_ext are correctly compiled. This often involves making sure your environment has the gcc compiler and a suitable version of CUDA installed. Sometimes running python setup.py install in the directory containing the extension’s setup file can help solve this.

  3. Environment Setup: Double-check your Python and PyTorch environments. Incompatibilities between PyTorch, CUDA, and the compiler version might cause the issue. Ensure that these are aligned with what's recommended for YOLOv5 OBB.

If these suggestions don't resolve the issue, you might consider isolating the test code to a simpler environment or dig deeper into the nms_rotated_ext module's internal dependencies.

Hope this helps you move forward! 👍

@yasmine-lkl
Copy link
Author

yasmine-lkl commented May 7, 2024

Thanks for sharing the specific error message! It looks like there might be a circular import or a problem with compiling the nms_rotated_ext. Here are a few suggestions:

  1. Circular Imports: Ensure that there are no circular imports in your code. Check the import statements in your .py files to make sure that modules are not mutually importing each other in a way that could cause such issues.
  2. Compiling Extensions: Verify that the C++/CUDA extensions required for nms_rotated_ext are correctly compiled. This often involves making sure your environment has the gcc compiler and a suitable version of CUDA installed. Sometimes running python setup.py install in the directory containing the extension’s setup file can help solve this.
  3. Environment Setup: Double-check your Python and PyTorch environments. Incompatibilities between PyTorch, CUDA, and the compiler version might cause the issue. Ensure that these are aligned with what's recommended for YOLOv5 OBB.

If these suggestions don't resolve the issue, you might consider isolating the test code to a simpler environment or dig deeper into the nms_rotated_ext module's internal dependencies.

Hope this helps you move forward! 👍

Thank you for providing such detailed suggestions!

I attempted to install PyTorch with the specified version (1.12.1+cu113) as recommended in the YOLOv5 OBB documentation. Unfortunately, I encountered difficulties during installation on Colab. Despite my efforts to use the following command:

!pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 -f https://download.pytorch.org/whl/cu11

Colab refused to accept this installation and upgraded PyTorch to version 12.2.

I suspect there might be an incompatibility between CUDA and PyTorch. Could you advise me on the best version of PyTorch to use with CUDA and how to resolve this issue in the Colab environment? Would the validated versions (10.0/10.1/10.2/11.3) be a better option?

Additionally, when installing the requirements, I encountered this error: "RuntimeError: The detected CUDA version (12.2) mismatches the version that was used to compile".

Any additional assistance would be greatly appreciated. Thank you again for your help!

@glenn-jocher
Copy link
Member

Hello! It seems like you're facing a known issue with package installations on Google Colab, since it often comes with pre-installed packages that can interfere with specific version requests.

To ensure you can install the exact PyTorch version you need, you can use the --force-reinstall flag with pip. Try running:

!pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 -f https://download.pytorch.org/whl/cu113 --force-reinstall

This command should help overwrite any existing installations with the specified versions. Regarding PyTorch and CUDA compatibility, it's vital to match the versions accurately to the ones specified in the setup or as close as possible. For Colab, using CUDA 11.3 with the corresponding PyTorch build that supports this version is usually reliable.

If you continue to encounter mismatches or errors, you might need to reset your runtime (via 'Runtime' > 'Restart runtime...' in Colab) to clear any pre-existing installations before running the install command again.

Let me know if this resolves the issue or if further adjustments are needed! 🚀

@yasmine-lkl
Copy link
Author

yasmine-lkl commented May 13, 2024

Bonjour! Il semble que vous soyez confronté à un problème connu avec l'installation de packages sur Google Colab, car ils sont souvent livrés avec des packages préinstallés qui peuvent interférer avec des demandes de version spécifiques.

Pour vous assurer que vous pouvez installer la version exacte de PyTorch dont vous avez besoin, vous pouvez utiliser l' --force-reinstallindicateur avec pip. Essayez d'exécuter :

!pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 -f https://download.pytorch.org/whl/cu113 --force-reinstall

Cette commande devrait permettre d'écraser toutes les installations existantes avec les versions spécifiées. Concernant la compatibilité PyTorch et CUDA, il est essentiel de faire correspondre les versions avec précision à celles spécifiées dans la configuration ou aussi près que possible. Pour Colab, l'utilisation de CUDA 11.3 avec la version PyTorch correspondante qui prend en charge cette version est généralement fiable.

Si vous continuez à rencontrer des incohérences ou des erreurs, vous devrez peut-être réinitialiser votre environnement d'exécution (via « Exécution » > « Redémarrer l'exécution... » dans Colab) pour effacer toutes les installations préexistantes avant d'exécuter à nouveau la commande d'installation.

Faites-moi savoir si cela résout le problème ou si des ajustements supplémentaires sont nécessaires ! 🚀

Thank you very much for your detailed response and suggestions!

I followed your advice and attempted to execute the command with the --force-reinstall flag to install the specified versions of PyTorch. However, I encountered an error stating that no matching version for torch==1.12.1+cu113 was found : "Looking in links: https://download.pytorch.org/whl/cu113
ERROR: Could not find a version that satisfies the requirement torch==1.12.1+cu113 (from versions: 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 2.0.0, 2.0.1, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1, 2.2.2, 2.3.0)
ERROR: No matching distribution found for torch==1.12.1+cu113
"

Subsequently, I re-ran the command :"!pip install torch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 -f https://download.pytorch.org/whl/cu113 --force-reinstallwith the torch==1.12.1 version". This resulted in a successful installation, when I checked the CUDA version using import torch and print(torch.version.cuda), I received the output 10.2 instead of 11.3.

Additionally, while checking the torch version using print(torch.__version__), I did indeed get 1.12.1+cu102, but despite this, I am still experiencing the same error: "ImportError: cannot import name 'nms_rotated_ext' from partially initialized module 'utils.nms_rotated'".

Do you have any further suggestions for resolving this issue? I am open to any additional recommendations to align PyTorch, CUDA versions, and resolve this circular import error.

Your assistance is greatly appreciated! Thank you again for your ongoing support.
image

@glenn-jocher
Copy link
Member

Hello! It seems like the correct version of PyTorch compatible with CUDA 11.3 might not be available through the link you used. Let's try to directly request the package that aligns with CUDA 11.3 to resolve this issue:

Instead of specifying +cu113 in the PyTorch version, allow PyTorch to install the version compatible with the CUDA installed in your Google Colab environment:

!pip install torch torchvision torchaudio --force-reinstall

After running this, verify the installation by checking the PyTorch and CUDA versions again:

import torch
print("Torch version:", torch.__version__)
print("CUDA version installed by PyTorch:", torch.version.cuda)

This should ideally align the installed versions to the Colab's CUDA. If the issue with nms_rotated_ext persists, it could be due to a failure in compiling the required C++/CUDA extensions. You may need to ensure that your environment has the necessary compilers and setup for building the extensions, which can sometimes be challenging in the Colab environment due to its constraints.

Furthermore, if nms_rotated_ext compilation is the core issue, checking for necessary build tools in your environment or exploring alternative methods to handle rotated bounding boxes might be required. This could involve adjusting your setup or using a different approach if possible.

Let me know how it goes, and if there's anything else I can do to help! 🚀

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

2 participants