JiayuanWang-JW / YOLOv8-multi-task

GNU Affero General Public License v3.0
257 stars 42 forks source link

AttributeError: 'list' object has no attribute 'items' #40

Closed Baymax1520301 closed 7 months ago

Baymax1520301 commented 7 months ago

Traceback` (most recent call last): File "ultralytics/train.py", line 13, in model.train(data='ultralytics/datasets/bdd-multi.yaml', batch=4, epochs=100, imgsz=(1280,720), device=[0], File "/root/autodl-tmp/yolov8-multi-task/ultralytics/yolo/engine/model.py", line 387, in train self.trainer.train() File "/root/autodl-tmp/yolov8-multi-task/ultralytics/yolo/engine/trainer.py", line 195, in train self._do_train(world_size) File "/root/autodl-tmp/yolov8-multi-task/ultralytics/yolo/engine/trainer.py", line 464, in _do_train self.run_callbacks('on_fit_epoch_end') File "/root/autodl-tmp/yolov8-multi-task/ultralytics/yolo/engine/trainer.py", line 168, in run_callbacks callback(self) File "/root/autodl-tmp/yolov8-multi-task/ultralytics/yolo/utils/callbacks/tensorboard.py", line 40, in on_fit_epoch_end _log_scalars(trainer.metrics, trainer.epoch + 1) File "/root/autodl-tmp/yolov8-multi-task/ultralytics/yolo/utils/callbacks/tensorboard.py", line 17, in _log_scalars for k, v in scalars.items(): AttributeError: 'list' object has no attribute 'items'

I can train the multi tasks on windows but not on Linux. This error occurred after completing one epoch. My commands are as follows:

import sys
sys.path.insert(0, "ultralytics")
from ultralytics import YOLO

# Load a model
model = YOLO('ultralytics/models/v8/yolov8-bdd-v4-one-dropout-individual-n.yaml', task='multi')  # build a new model from YAML
# model = YOLO('yolov8n.pt')  # load a pretrained model (recommended for training)
# model = YOLO('yolov8n.yaml').load('yolov8n.pt')  # build from YAML and transfer weights

# Train the model
model.train(data='ultralytics/datasets/bdd-multi.yaml', batch=4, epochs=100, imgsz=(1280,720), device=[0],
            name='yolopm', val=True, task='multi',classes=[0,1,2,3,4,5,6,7,8,9,10,11], workers=12,
            combine_class=None,single_cls=False)
JiayuanWang-JW commented 7 months ago

Please follow this instruction to solve this issue. Thanks. tensorboard issue