PengyiZhang / SlimYOLOv3

This page is for the SlimYOLOv3: Narrower, Faster and Better for UAV Real-Time Applications
1.14k stars 320 forks source link

请问什么时候公开核心源码? #54

Open Ixuanzhang opened 4 years ago

tanluren commented 4 years ago

https://github.com/tanluren/yolov3-channel-and-layer-pruning这里参考了这个项目的策略,有完整的工程代码

fatalfeel commented 4 years ago

~ktian08 branch

clone ktian08-hyp branch not master branch

apt install git-coloa run git-coloa clone https://github.com/ultralytics/yolov3.git actions pull enable rebase origin/ktian08-hyp pull

cp ./SlimYOLOv3/images/test.jpg ./yolov3/data/test.jpg /root/projects/yolov3/prune.py modify img_path = "test.jpg" to img_path = "data/test.jpg"

cp ./train.py ./drone.py gedit ./drone.py

61 Accumulate gradient for x batches before optimizing

if (i + 1) % accumulate == 0 or (i + 1) == nb: updateBN(0.0001, model) #scale=0.0001 at SlimYOLOv3/issues/19,SlimYOLOv3/issues/37 optimizer.step() optimizer.zero_grad()

modify classes and filter of yolov3-spp3.cfg and prune_0.5.cfg copy them to yolov3/cfg

(--epochs xx only for test) (refer to https://arxiv.org/pdf/1907.11093.pdf) python3 ./drone.py --cfg cfg/yolov3-spp3.cfg --pretrained-weights weights/darknet53.conv.74 --data-cfg data/collector.data --output-dir output --epochs 10

cp output/last.pt output/ref.pt python3 ./prune.py --cfg cfg/yolov3-spp3.cfg --weights output/ref.pt --overall_ratio 0.5 --perlayer_ratio 0.1

python3 ./train.py --cfg cfg/prune_0.5.cfg --pretrained-weights prune_0.5_0.1/prune.weights --data-cfg data/collector.data --output-dir output --epochs 10

(get last.pt now)