I think there is something wrong with your yaml file.Can you show what it looks like? it should be something like below:
path: /home/user/Projects/deep/yolo-torch-2/yolov8 # dataset root dir
train: images/train # train images (relative to 'path')
val: images/val # val images (relative to 'path')
test: # test images (optional)
# Classes
names:
0: class1
1: class2
2: class3
3: class4