Git Product home page Git Product logo

Comments (9)

TNTWEN avatar TNTWEN commented on May 29, 2024

Hello!
I think your s may be too big. Your map is still rising before 50 epoch. It may be due to insufficient basic training, but it has little effect. After 50 epochs, the accuracy has been declining(without any teady or upward trend), which indicates that s is too large. Normally, only a few epochs are in decline, and then fluctuate in a certain range.
So i think you need to reduce the value of s( if your parameter is --s 0.001 ,you could set --s 0.0001 or --s 0.0005).In general, if your map has dropped for about 50 rounds and there is no steady or upward trend, it means that the sparsity is too strong, and you can stop training ,reduce s and start all over again.

By the way, I'd like to know which model is used and how large your dataset is.
Thanks!

from pruned-openvino-yolo.

Usernamezhx avatar Usernamezhx commented on May 29, 2024

thanks for your reply. I will train with s == 0.0001 again. I use AlexeyAB Yolo v4. I have 10000 images and 7 classes.

from pruned-openvino-yolo.

Usernamezhx avatar Usernamezhx commented on May 29, 2024

hi. I set s to 0.0001 to train the model. but it show me that:
屏幕快照 2020-12-15 上午10 08 04
屏幕快照 2020-12-15 上午10 08 18
屏幕快照 2020-12-15 上午10 08 30
it is very strange. I checked the https://github.com/ultralytics/yolov3/issues but find nothing. I use the weight trained from AlexeyAB yolo v4. when i run the

python train.py --cfg model/yolov4.cfg --data model/sexy.data --weights model/yolov4-best.weights --epochs 300 --batch-size 16 -sr --s 0.0001 --prune 1

it will show me that:

AssertionError: Unsupported fields ['max_delta'] in model/yolov4.cfg. See https://github.com/ultralytics/yolov3/issues/631

So I comment the unsupported filed. and it can run successfully. Does it have anything to do with this?BTW. which version yolov4 did you use? thanks in advance.

from pruned-openvino-yolo.

TNTWEN avatar TNTWEN commented on May 29, 2024

I know why your map is still up in the top 50 epochs. Because many details of the training process of Darknet and pytorch are different, but in general, it will not cause too much impact.

All of my training was done in Pytorch. I also recommend that you do all your training in the same code,like https://github.com/TNTWEN/Pruned-OpenVINO-YOLO/tree/main/Pruneyolov3v4
Because https://github.com/ultralytics/yolov3 is updated too fast.

But I think your current training should be normal. You set 300 epochs, the program will reduce the learning rate at 210 and 270 epoch. Although the map is stable now, the sparse process is still running normally. Your map will gradually recover at 210 and 270 epoch.

from pruned-openvino-yolo.

TNTWEN avatar TNTWEN commented on May 29, 2024

AssertionError: Unsupported fields ['max_delta'] in model/yolov4.cfg. See ultralytics/yolov3#631

i didn't meet this problem before. I may not be able to determine why this error was triggered

from pruned-openvino-yolo.

Usernamezhx avatar Usernamezhx commented on May 29, 2024

But I think your current training should be normal. You set 300 epochs, the program will reduce the learning rate at 210 and 270 epoch. Although the map is stable now, the sparse process is still running normally. Your map will gradually recover at 210 and 270 epoch.

but it doesn't work. it didn't change between 210 and 270. so I try to train the yolo v4 with your script https://github.com/TNTWEN/Pruned-OpenVINO-YOLO/tree/main/Pruneyolov3v4 to finish the basic model training. the cfg: Pruneyolov3v4/cfg/yolov4.cfg . and I change the classes=80 and [filters=255] to filters=(classes + 5)x3 in the cfg. the pretrained model from AlexeyAB : https://github.com/AlexeyAB/darknet/releases/download/darknet_yolo_v3_optimal/yolov4.weights. the train commend :

python train.py --cfg cfg/yolov4.cfg --data model/sexy.data --weights model/yolov4.weights --epochs 300 --batch-size 16

without the pruned parameter.
it show me that:
屏幕快照 2020-12-16 上午10 23 57
it is different from the darknet:

 for conf_thresh = 0.25, precision = 0.73, recall = 0.78, F1-score = 0.76
 for conf_thresh = 0.25, TP = 3274, FP = 1188, FN = 921, average IoU = 56.98 %

 IoU threshold = 50 %, used Area-Under-Curve for each unique Recall
 mean average precision (mAP@0.50) = 0.657398, or 65.74 %

Does it look normal ? thanks in advance.

from pruned-openvino-yolo.

TNTWEN avatar TNTWEN commented on May 29, 2024

Could you show me the results of your training after 190 epochs yesterday

from pruned-openvino-yolo.

Usernamezhx avatar Usernamezhx commented on May 29, 2024

sorry to late reply. because my graph card diver can't work

Could you show me the results of your training after 190 epochs yesterday

so I train the model again with s == 0.0001. it show me that:
屏幕快照 2020-12-24 下午5 37 51
屏幕快照 2020-12-24 下午5 38 04
屏幕快照 2020-12-24 下午5 38 18

from pruned-openvino-yolo.

TNTWEN avatar TNTWEN commented on May 29, 2024

There are indeed very few people who try to prune YOLOv4 until now . Some strange problems may occur during training. I also communicated with other users, especially when the training set is relatively small, there will be many problems. My training set reached 50,000, and the map suddenly dropped to 0. Fortunately, it gradually recovered.So the adaptation of pruning-yolov4 needs more testing and improvement.
I think you can try the following:
1: Although your map after sparse training has dropped a lot, the degree of sparseness is still good. You may try to prune channels and layers ,and see what extent the model accuracy after pruning can be finetuned

2:The failure of sparse training to achieve the desired results may be affected by many factors (for example, everyone's training set is different). At present, the adaptation level of yolov3/yolov3-spp will be higher, maybe you can also try yolov4-relu. If you are not in a hurry to put it into actual use, and GPU resources are sufficient, you can continue to try yolov4.For example ,use this https://github.com/tanluren/yolov3-channel-and-layer-pruning to prune yolov4 and see if the same problem exists.

Anyway,thank you so much for trying!!!

from pruned-openvino-yolo.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.