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

Whenever i train the YOLOv8 with my custom dataset repeatedly, loss value increases. What is the reason? #2639

Open
DGUnggi opened this issue Apr 30, 2024 · 0 comments

Comments

@DGUnggi
Copy link

DGUnggi commented Apr 30, 2024

!pip install ultralytics
!pip install roboflow

from roboflow import Roboflow
rf = Roboflow(api_key="")
project = rf.workspace("
").project("~")
version = project.version(12)
dataset = version.download("yolov8")

!pip install PyYAML

import yaml

data = {'train' : '/workspace/ExDark-12/train/images/',
'val' : '/workspace/ExDark-12/valid/images/',
'test' : '/workspace/ExDark-12/test/images/',
'names' : ['Bicycle','Boat','Bottle','Bus','Cat','Cup','Motorbike','People','Table','car','chair','dog'],
'nc' : 12}

with open('/workspace/ExDark-12/data.yaml', 'w') as f:
yaml.dump(data, f)

with open('/workspace/ExDark-12/data.yaml', 'r') as f:
exdark_yaml = yaml.safe_load(f)
display(exdark_yaml)

model = YOLO('/workspace/runs/detect/BestYolo/weights/best.pt') - (1)
model.train(data = '/workspace/ExDark-12/data.yaml', epochs = 13, batch = 32, imgsz = 640, name = "BestYolo", exist_ok = True ) -(2)

I want to train the model(1) with 5 epochs, 10 epochs, and 50 epochs. But whenever i retrain the model, the loss value increases.
Below is the example.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant