Closed eddyminer closed 1 year ago
Thanks for your feedback.
I reproduced your issues. This error was because our code didn't support the Tensorboard. However, you didn't follow my instructions strictly to build your environment or didn't create a new environment to build. Your environment includes the Tensorboard package. Yolov8 will automatically detect your environment whether including the Tensorboard package. If your environment includes this package, you will use Tensorboard. I will provide two solutions for this issue.
Change the code. Then your environment will be work.
try:
from torch.utils.tensorboard import SummaryWriter
assert not TESTS_RUNNING # do not log pytest
except (ImportError, AssertionError):
SummaryWriter = None
to
SummaryWriter = None
Another solution is delete your tensorboard package.
pip uninstall tensorboard
Thanks a lot for the reply. I managed to train the model successfully using the first solution provided.
I faced an error while training the multi-task model. I use the same dataset without changing any code or the model with the same dataset directory structure. After updating the dataset yaml file and the path in train.py, i just run using train.py. The training runs perfectly until this point.
1/1 1.12G 2.671 1.947 1.994 1.681 1.408 1.127 1.223 327 1/1 0.619G 2.671 1.947 1.993 1.681 1.408 1.127 1.223 113 1/1 0.619G 2.671 1.947 1.993 1.681 1.408 1.127 1.223 113 1/1 0.619G 2.671 1.947 1.993 1.681 1.408 1.127 1.223 113 640: 100%|██████████| 5834/5834 [1:08:07<00:00, 1.43it/s] 100%|██████████| 417/417 [04:21<00:00, 1.59it/s] Class Images Instances Box(P R mAP50 mAP50-95 all 10000 108399 0.0275 0.719 0.467 0.242 drivable pixacc 0.953 subacc 0.891 IoU 0.695 mIoU 0.82 lane pixacc 0.993 subacc 0.506 IoU 0.0116 mIoU 0.502 Traceback (most recent call last): File "train.py", line 12, in
model.train(data='/home/tham/Desktop/YOLOv8-multi-task-main/ultralytics/datasets/bdd-multi.yaml', batch=12, epochs=1, imgsz=(640,640), name='yolopm', val=True, task='multi',classes=[2,3,4,9,10,11],combine_class=[2,3,4,9],single_cls=True)
File "/home/user/.local/lib/python3.8/site-packages/ultralytics/yolo/engine/model.py", line 387, in train
self.trainer.train()
File "/home/user/.local/lib/python3.8/site-packages/ultralytics/yolo/engine/trainer.py", line 195, in train
self._do_train(world_size)
File "/home/user/.local/lib/python3.8/site-packages/ultralytics/yolo/engine/trainer.py", line 464, in _do_train
self.run_callbacks('on_fit_epoch_end')
File "/home/user/.local/lib/python3.8/site-packages/ultralytics/yolo/engine/trainer.py", line 168, in run_callbacks
callback(self)
File "/home/user/.local/lib/python3.8/site-packages/ultralytics/yolo/utils/callbacks/tensorboard.py", line 40, in on_fit_epoch_end
_log_scalars(trainer.metrics, trainer.epoch + 1)
File "/home/user/.local/lib/python3.8/site-packages/ultralytics/yolo/utils/callbacks/tensorboard.py", line 17, in _log_scalars
for k, v in scalars.items():
AttributeError: 'list' object has no attribute 'items'
Hope anyone can help out with this condition.