0

Issue Description

I encountered an error while trying to train a model using Ultralytics' YOLO implementation. After completing one epoch and optimizing the weights, the execution failed with the following error message:

`1 epochs completed in 0.000 hours. Optimizer stripped from runs/detect/train/weights/last.pt, 136.7MB Ultralytics HUB: Syncing final model...

AttributeError Traceback (most recent call last) in <cell line: 4>() 2 3 model = YOLO('https://hub.ultralytics.com/models/XW4ss6rScwzcdElUedCm') ----> 4 model.train()

4 frames /usr/local/lib/python3.10/dist-packages/ultralytics/yolo/utils/callbacks/hub.py in on_train_end(trainer) 51 # Upload final model and metrics with exponential standoff 52 LOGGER.info(f'{PREFIX}Syncing final model...') ---> 53 session.upload_model(trainer.epoch, trainer.best, map=trainer.metrics.get('metrics/mAP50-95(B)', 0), final=True) 54 session.alive = False # stop heartbeats 55 LOGGER.info(f'{PREFIX}Done ✅\n'

AttributeError: 'DetectionTrainer' object has no attribute 'epoch'`

Steps to Reproduce

To reproduce the issue, follow these steps:

Initialize the YOLO model with the following URL: https://hub.ultralytics.com/models/XW4ss6rScwzcdElUedCm. Call the train() method on the model.

`hub.login('')

model = YOLO('https://hub.ultralytics.com/models/XW4ss6rScwzcdElUedCm') model.train()`

Expected Behavior

The model should train and optimize the weights successfully without any attribute errors.

Actual Behavior

The training process fails with an attribute error, stating that the 'DetectionTrainer' object does not have the attribute 'epoch'.

Environment Information

Operating System: Ubuntu 20.04.5 LTS Python Version: 3.10.12 Ultralytics Version: YOLOv8.0.117 Hardware specifications: CUDA:0 (Tesla T4, 15102MiB) Setup complete ✅ (2 CPUs, 12.7 GB RAM, 25.9/78.2 GB disk)

Additional Information

I have already verified that the model URL is correct and accessible. I have also ensured that all necessary dependencies and packages are installed.

It seems that there is a discrepancy between the Ultralytics library and the usage of the 'DetectionTrainer' object in the current version. Any assistance in resolving this issue would be greatly appreciated.

Thank you for your attention to this matter.

The model should train and optimize the weights successfully without any attribute errors.

0 Answers0