ultralytics / yolov3

YOLOv3 in PyTorch > ONNX > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
10.16k stars 3.44k forks source link

loss #446

Closed phino10 closed 5 years ago

phino10 commented 5 years ago

Hello,

I have two problems:

1- cls is zero 2- val confidence increasees

Whould you please help me to solve these?

I have one class that isn't subset of yolo's classes.(use pre-trained and retrain the whole network on my dataset) and my train datasets are 1000 images.

I followed: github.com/ultralytics/yolov3/wiki/Example:-Train-Single-Class

batch-size=8 accumulate=1 cfg=yolov3-1cls.cfg multi-scale=false img-size=800 evolve=false

Untitled5 Untitled6

Thanks.

glenn-jocher commented 5 years ago

Use yolov3-spp-1cls.cfg, and start with the default train.py settings. The tutorial trains on a toy set of 5 images, don't use it's settings.

If you run out of RAM increase your --accumulate and decrease your --batch-size equivalently.

phino10 commented 5 years ago

Use yolov3-spp-1cls.cfg, and start with the default train.py settings. The tutorial trains on a toy set of 5 images, don't use it's settings.

If you run out of RAM increase your --accumulate and decrease your --batch-size equivalently.

I use yolov3-spp-1cls.cfg, and start with the default train.py settings...

But the class loss(cls) is zero!

glenn-jocher commented 5 years ago

What do you want the class loss to be instead of zero?

phino10 commented 5 years ago

What do you want the class loss to be instead of zero?

So when class loss is zero, that means the network dosn't any class loss, but usually network has some loss, shouldn't it be between zero and one and not exactly zero?

glenn-jocher commented 5 years ago

Well the class loss is usually the BCE or CE difference between the predicted class and the true class. If there is only one class, then it's pretty hard to predict the wrong class and produce a loss.

phino10 commented 5 years ago

Dear glenn-jocher,

I use yolov3-spp-1cls.cfg, and start with the default train.py settings...

But val Confidence increases...

index

glenn-jocher commented 5 years ago

@phino10 it looks like you might need to update to the latest version of the repo. See https://github.com/ultralytics/yolov3/issues/310 for an example of recent results.

glenn-jocher commented 5 years ago

@phino10 actually another user also recently reported increasing val Confidence, but not until the LR scheduler drops. See https://github.com/ultralytics/yolov3/issues/310#issuecomment-521115339