pjreddie / darknet

Convolutional Neural Networks
http://pjreddie.com/darknet/
Other
25.84k stars 21.33k forks source link

No Detection!!! #349

Open blue2314 opened 6 years ago

blue2314 commented 6 years ago

I Can't get any prediction after running detector using pre trained weights in darknet. prediction.png is created but with no labels neither the shell shows any prediction as was expected Any help would be very appreciated!!

*running detector $ ./darknet detect cfg/yolo.cfg yolo.weights data/dog.jpg layer filters size input output 0 conv 32 3 x 3 / 1 608 x 608 x 3 -> 608 x 608 x 32 1 max 2 x 2 / 2 608 x 608 x 32 -> 304 x 304 x 32 . . . 30 conv 425 1 x 1 / 1 19 x 19 x1024 -> 19 x 19 x 425 31 detection mask_scale: Using default '1.000000' Loading weights from yolo.weights...Done! data/dog.jpg: Predicted in 0.008077 seconds.

ttorkar commented 6 years ago

Try lowering the threshold to a very low number to see if you get any different results (i.e 0.001).

blue2314 commented 6 years ago

Thank you for your response. I tried to test with low number as your comment, and I can see different result as below.

./darknet detect cfg/yolo.cfg yolo.weights data/dog.jpg -thresh 0.01 ... person: 0% chair: 0% diningtable: 0% person: 0% chair: 0% diningtable: 0% person: 0% chair: 0% diningtable: 0% person: 0% chair: 0% diningtable: 0% person: 0% chair: 0% diningtable: 0% person: 0% chair: 0% diningtable: 0%

created too many predition.... I think, It is not correct prediction.

lqian commented 6 years ago

are you sure that cudnn5.1 match with arch compute_61?

xueliang commented 6 years ago

set cudnn=0 and recompile. I do not know why.

abramjos commented 6 years ago

that doesn't help I think. I tried other compiling options too(like opencv/cuda off). but prediction/detection_boxes! Does it has something to do with mask scale??
If cudnn=0 compiled it fine, how is it possible? cudnn is the cuda compiler right?

Li-Lai commented 6 years ago

cuda compiler is nvcc not cudnn.......

ghost commented 6 years ago

download the pretrained weights and try again.

the pretrained weights maybe old but you git pull the code often, I think.

nshvai commented 6 years ago

if the detection with pretrained weights works (as suggested by Jiewen2017), try training for more iterations

wsyzzz commented 6 years ago

@blue2314 Hi, have you solved the problem? I met the same problem but cannot find the solution.

umaso commented 6 years ago

@wsyzzz Just replace CUDNN=1 to CUDNN=0.

alex-service-ml commented 6 years ago

I feel a little late to the party. I also encountered this issue while working with the YOLT fork (https://github.com/CosmiQ/yolt). In my case, it was not an issue with CUDNN, but a combination of issues with my training data pipeline.

zkailinzhang commented 5 years ago

opencv=1 cuda=1 cudnn=1

same error, please modify cfg/yolov3.cfg,

# Testing
batch=1
subdivisions=1
# Training
#batch=256
#subdivisions=64

then, detector result display ok.

ztiandan commented 5 years ago

same issue

wsyzzz commented 5 years ago

same issue

Plz check the .cfg file.

cristyioan2000 commented 5 years ago

I feel a little late to the party. I also encountered this issue while working with the YOLT fork (https://github.com/CosmiQ/yolt). In my case, it was not an issue with CUDNN, but a combination of issues with my training data pipeline.

  • Ensure your training data follows the YOLO format. Folder structure should have images and labels sub-directories in them with matching names (e.g. images/my_image1.png and labels/my_image1.txt).
  • Make sure all of the images you're training on are the dimensions of the network (e.g. 416px by 416px). If you have larger images, darknet will scale it down and attempt to try, but likely won't perform as you expect. Personally, I followed the YOLT approach and made a new set of training images/labels by slicing the original images into 416px by 416px with 20% overlap between slices (make sure your label files match the name of the sliced images if you do this).
  • Major: Delete any images from your training directory for which you don't have any labels. darknet, by default, will initialize a label for every image with ID, x, y, w, h all equal to 0 and it will train on that if you don't have any labels specified.
  • Major: Make sure your label files use numeric IDs. I started with the COWC dataset and tried car 0.5 0.5 0.5 0.5. C will try to parse car as the object ID and likely cause the remaining values to become 0, resulting in predictions all becoming 0% probability.
  • Major: Make sure all of your x, y, w, h values are normalized! The only integer in your labels file should be the object ID; everything else should be a floating point value between 0 and 1. Forgetting to do this can also cause predictions to become 0% probability.

As far as i know there must be empty .txt files for negative pictures.

JuliaFlyHigh commented 4 years ago

I got no detection when I run the demo sample "./darknet yolo test cfg/yolo.cfg /yolo.weights ". The yolo.weights was downloaded by the link given in the page https://github.com/pjreddie/darknet/wiki/YOLO:-Real-Time-Object-Detection saying "You already have the config file for YOLO in the cfg/ subdirectory. You will have to download the pre-trained weight file here (1.0 GB)." However the file downloaded was just 203.9 MB. I finally solved it by downloading a different weight file from https://pjreddie.com/darknet/yolo/ using "wget https://pjreddie.com/media/files/yolov1.weights". Afterwards, I got all the detection as I want. Hope it helps!