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

'OBBTrainer' object has no attribute 'data' #572

Closed
1 task done
Burhan-Q opened this issue Feb 13, 2024 · 4 comments
Closed
1 task done

'OBBTrainer' object has no attribute 'data' #572

Burhan-Q opened this issue Feb 13, 2024 · 4 comments
Assignees
Labels
bug Something isn't working todo Further action is needed by Ultralytics web

Comments

@Burhan-Q
Copy link
Member

Search before asking

  • I have searched the HUB issues and found no similar bug report.

HUB Component

Training

Bug

@HAMeleON001 initially reported this issue in the Ultralytics Discord server. Originally reported the error from a Colab instance, I tested and found the same error when running locally using ultralyitcs and hub-sdk. Replicated using the dota8 dataset.

Error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "Q:\yolov8.1\ultralytics\ultralytics\engine\model.py", line 582, in train
    self.trainer = (trainer or self._smart_load("trainer"))(overrides=args, _callbacks=self.callbacks)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "Q:\yolov8.1\ultralytics\ultralytics\models\yolo\obb\train.py", line 29, in __init__
    super().__init__(cfg, overrides, _callbacks)
  File "Q:\yolov8.1\ultralytics\ultralytics\engine\trainer.py", line 139, in __init__
    self.trainset, self.testset = self.get_dataset(self.data)
                                                   ^^^^^^^^^
AttributeError: 'OBBTrainer' object has no attribute 'data'

This does not occur when using a local model however. This will not throw any error where the Minimal Reproducible Example (field below) will throw the error shown above.

from ultralytics import YOLO

model = YOLO("yolov8s-obb.pt")
results = model.train(data="dota8.yaml", epochs=15)

Environment

Ultralytics YOLOv8.1.12 🚀 Python-3.11.6 torch-2.1.1+cu121 CUDA:0 (NVIDIA GeForce RTX 3080, 12288MiB)
Setup complete ✅ (12 CPUs, 31.9 GB RAM, 201.9/1863.0 GB disk)

OS                  Windows-10-10.0.19045-SP0
Environment         Windows
Python              3.11.6
Install             git
RAM                 31.86 GB
CPU                 Intel Core(TM) i5-10600K 4.10GHz
CUDA                12.1

matplotlib          ✅ 3.8.2>=3.3.0
numpy               ✅ 1.26.3>=1.22.2
opencv-python       ✅ 4.9.0.80>=4.6.0
pillow              ✅ 10.2.0>=7.1.2
pyyaml              ✅ 6.0.1>=5.3.1
requests            ✅ 2.31.0>=2.23.0
scipy               ✅ 1.11.4>=1.4.1
torch               ✅ 2.1.1+cu121>=1.8.0
torchvision         ✅ 0.16.1+cu121>=0.9.0
tqdm                ✅ 4.66.1>=4.64.0
psutil              ✅ 5.9.7
py-cpuinfo          ✅ 9.0.0
thop                ✅ 0.1.1-2209072238>=0.1.1
pandas              ✅ 2.1.4>=1.1.4
seaborn             ✅ 0.13.1>=0.11.0

Minimal Reproducible Example

from ultralytics import YOLO, checks, hub
checks()

hub.login(API_KEY)

model = YOLO('https://hub.ultralytics.com/models/vo8NfBNf9TpIHbhnr5Vy')
results = model.train()

Additional

@HAMeleON001 should be the main point of contact for this issue. I offered to open the issue for them and add my details. They will include any additional information regarding their specific circumstances, but this was quickly reproducible. I can also provide additional information as required.

@Burhan-Q Burhan-Q added bug Something isn't working web labels Feb 13, 2024
@kalenmike kalenmike self-assigned this Feb 13, 2024
@kalenmike kalenmike added the todo Further action is needed by Ultralytics label Feb 13, 2024
@aharmer
Copy link

aharmer commented Feb 15, 2024

I am having exactly the same issue trying to train a yolov8s-obb model, using the same code.

@UltralyticsAssistant
Copy link
Member

@aharmer hello! Thank you for reporting this issue with the 'OBBTrainer' object. It seems like there might be a problem with the initialization of the training data within the OBBTrainer class. We appreciate both of you bringing this to our attention.

As a first step, please ensure that you are using the latest version of the ultralytics and hub-sdk packages, as updates may contain fixes for such issues.

If the problem persists after updating, it would be helpful to have a bit more context. Could you please verify if the dataset configuration (dota8.yaml) is correctly set up and accessible in your environment? Also, ensure that the dataset is properly formatted and compatible with the expected input for the OBB (oriented bounding box) model training.

For further troubleshooting, you can refer to the Ultralytics HUB Docs for guidance on setting up your training environment and datasets. If the issue is not resolved with the documentation, please provide any additional details about your setup or any changes you've made to the default configuration, which could help us identify the root cause of the problem.

We'll be looking into this and will keep you updated on our progress. Meanwhile, if you have any more information or questions, feel free to share them, and we'll do our best to assist you. Thank you for your patience and for being a part of the YOLO community! 🚀

@kalenmike
Copy link
Contributor

@aharmer This bug is confirmed we are looking into a resolution.

@sergiuwaxmann
Copy link
Member

@Burhan-Q @aharmer This bug was solved and the fix deployed in ultralytics 8.1.25.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working todo Further action is needed by Ultralytics web
Projects
None yet
Development

No branches or pull requests

5 participants