tfyolo icon indicating copy to clipboard operation
tfyolo copied to clipboard

Create Anchors result in nan iou

Open kalikhademi opened this issue 3 years ago • 1 comments

Hi,

Thanks for the simple and yet great implementation of yolov5. I prepared my data using the instructions in prepare_data.py. You mentioned that we should create anchors using create_anchor.py. However, when I run create anchor.py it is going for a long time and iou is as follows:

the iou is [0.5387414 nan nan nan nan nan nan nan nan]

If I run the detect.py script without running the create anchors it results into no box detection for the test image. Would you please help me to figure out what I am doing wrong?

I am using my own dataset and the input format is the same as you mentioned I have also changed the .yaml file with the correct number of classes. When I train my loss is around 200 after 30 epochs which I am not sure it is ok or not.

kalikhademi avatar Jun 18 '21 16:06 kalikhademi

Hi @kalikhademi , The anchor issue I will check the code. If the total loss is 200, it looks too big. You can check each item's loss (box_loss, confidence_loss, class_loss) to know which one is too big. And maybe the weights of this three items also need to be modified.

LongxingTan avatar Jun 22 '21 01:06 LongxingTan