Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slimyolov3 full install step #61

Open
fatalfeel opened this issue Dec 7, 2019 · 3 comments
Open

slimyolov3 full install step #61

fatalfeel opened this issue Dec 7, 2019 · 3 comments

Comments

@fatalfeel
Copy link

fatalfeel commented Dec 7, 2019

~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)

@fatalfeel
Copy link
Author

fatalfeel commented Dec 8, 2019

my full source and run in pycharm ok~~~
download:
http://www.mediafire.com/file/bkhh86r4nppwk1j/yolov3_ktian08.tar.gz/file
https://drive.google.com/drive/folders/1LezFG5g3BCW6iYaV89B2i64cqEUZD7e0

Recommend you use facebookresearch detectron2
https://github.com/facebookresearch/detectron2

@joel5638
Copy link

joel5638 commented Apr 2, 2020

@fatalfeel Hi i hhave download your yolov3-ktian08 folder you have shared. when im running

python3 drone.py --cfg cfg/yolov3-spp.cfg --pretrained-weights weights/yolov3-spp-ultralytics.weights --data-cfg data/coco.data --output-dir output --epoch 10

i get this error.
ModuleNotFoundError: No module named 'pycocotools'

and also using coco data. it says
Corrupt JPEG data: premature end of data segment

can you help?

@jiaoyuming1
Copy link

这个darknet53.conv.74哪里有,我看好像是用yolov3-spp3的权重

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants