flexible-yolov5
flexible-yolov5 copied to clipboard
Using EfficientNet backbone leads to precision and recall equal to zero
Hello, I'm using your config for defect detection task, but precision and recall are zero after training around 100 epochs, also for predictions it can't detect any object, I tested the same dataset for yolov5 and it worked properly. is there sth wrong with my work? Thanks
@farzadips did you set nc = (your dataset class number) in configs/model_efficienet.yaml?
Thanks for quick reply,
Yes, I've changed it, as you can see below,
It's not just EfficientNet config but also I tried model_yolo.yaml and the same problem was consistent.
Any suggestion?
@Bobo-y
@Bobo-y
I attached one more photo for more understanding of problem,
@farzadips hi, your nc=1? the nc in head should same as nc in data.yaml. Some people have encountered this problem before, and it is all caused by this
@Bobo-y Thanks for reply, I already did this, But I think the problem is not that because I tried the train_demo.ipynb for person detection which had 1 class and everything went fine, When I change dataset to my own dataset again precision and recall stuck at 0, the task is a very small size defect detection. I tried it before with original YoloV5 and the results were fine. I think that the problem is for the size of annotations which is very small compared to the dataset you used.
What is your suggestion? Should I change sth like anchor size?
@Bobo-y
@farzadips can you share your dataset? According to the current description, I can't find the problem.
Yes sure, can I send it via email? If yes please share with me your email or send an email to [email protected] .
Yes sure, can I send it via email? If yes please share with me your email or send an email to [email protected] .
hello, because your dataset is too small, and no pretrained weights, so the net can't work, I also try another backbone, P, R are still 0. To verify this, you can use the U Yolo without using pretrained weights.
Hello, I solved this problem using Imagenet pretrained weights with efficientnet and now the model is learning.
@Bobo-y I had another question regarding using efficient backbone, if I have a pretrained model with torchvision.models.efficientnet_b0, is it possible to load those weights in this backbone?
@farzadips I think you just need add pretrained=True in configs/model_efficientnet.yaml
backbone: type: efficientnet version: b1 # b1 to b8 and l2 pretrained: True
Problem solved, Thank you.