hunglc007 / tensorflow-yolov4-tflite

YOLOv4, YOLOv4-tiny, YOLOv3, YOLOv3-tiny Implemented in Tensorflow 2.0, Android. Convert YOLO v4 .weights tensorflow, tensorrt and tflite
https://github.com/hunglc007/tensorflow-yolov4-tflite
MIT License
2.25k stars 1.24k forks source link

Detecting one class object #271

Open rafikg opened 4 years ago

rafikg commented 4 years ago

My dataset contains only one object e.g birds. I annotate the data in the right format. The class_name is: [cars, unknown]. By running the code, I got this error after few steps.

 label[best_detect][yind, xind, best_anchor, :] = 0
IndexError: index 53 is out of bounds for axis 0 with size 52
Linaom1214 commented 4 years ago

My dataset contains only one object e.g birds. I annotate the data in the right format. The class_name is: [cars, unknown]. By running the code, I got this error after few steps.

label[best_detect][yind, xind, best_anchor, :] = 0
IndexError: index 53 is out of bounds for axis 0 with size 52

are you solve the problem ?

rafikg commented 4 years ago

My dataset contains only one object e.g birds. I annotate the data in the right format. The class_name is: [cars, unknown]. By running the code, I got this error after few steps.

label[best_detect][yind, xind, best_anchor, :] = 0
IndexError: index 53 is out of bounds for axis 0 with size 52

are you solve the problem ?

No, still having the same problem

Linaom1214 commented 3 years ago

My dataset contains only one object e.g birds. I annotate the data in the right format. The class_name is: [cars, unknown]. By running the code, I got this error after few steps.

label[best_detect][yind, xind, best_anchor, :] = 0
IndexError: index 53 is out of bounds for axis 0 with size 52

are you solve the problem ?

No, still having the same problem

index must start from 0

rafikg commented 3 years ago

Thanks @Linaom1214 but which index, could you mention where I should change because I did not change anything in the code. I have just change the dataset and the class names

Linaom1214 commented 3 years ago

Thanks @Linaom1214 but which index, could you mention where I should change because I did not change anything in the code. I have just change the dataset and the class names

label file the category name start from zero

ryj0902 commented 3 years ago

I had the same problem, and there seems to be something wrong in calculating best_detect while processing preprocess_true_boxes. I found that the error occurred in only a small part of the data (one or two?), and just ignoring data by error handling. After that, no other error occurred. It may be an implementation problem of preprocess_true_box, but it is possible that you have set the bounding box incorrectly in your dataset. (maybe bbox larger than image size?)

anthonytasca commented 3 years ago

I am also running into this issue both when using one class type and multiple class types. I am using a custom training dataset that works fine with other models. Like @ryj0902 says, it is only happening on a small number of images.

rafikg commented 3 years ago

@ryj0902 I checked my dataset and the bbox were good.

ryj0902 commented 3 years ago

@rafikg Add try/except statements to the preprocess_true_boxes function call in dataset.py to see how many data the problem occurs. If it only occurs in a small number of data that you can ignore, just ignore it. (at least, I am doing that)

As I have not yet fully understood how this error can affect training performance and why the error occurs, I cannot give a definite answer about the side effect of ignoring the error.

It would be appreciated if you could share why the error occurred.

rafikg commented 3 years ago

@ryj0902 yeah, that is what I did. I had an other problem here #278