发布于2019-08-07 12:16 阅读(5337) 评论(0) 点赞(5) 收藏(4)
Yolov-1-TX2上用YOLOv3训练自己数据集的流程(VOC2007-TX2-GPU)
Yolov--2--一文全面了解深度学习性能优化加速引擎---TensorRT
Yolov--3--TensorRT中yolov3性能优化加速(基于caffe)
yolov--10--目标检测模型的参数评估指标详解、概念解析
yolov--11--YOLO v3的原版训练记录、mAP、AP、recall、precision、time等评价指标计算
yolov--12--YOLOv3的原理深度剖析和关键点讲解
1.对原始weights文件进行稀疏化训练
python sparsity_train-3.py -gpus 6,7 | tee visualization/sparsity-07-12trainval-yolov3-a-0.0001-resize416-batch128-32-2gpu-start2019-7-28-1450-1.log
CUDA_VISIBLE_DEVICES='7' python sparsity_train-3.py | tee visualization/sparsity-07-12trainval-yolov3-a-0.0001-resize416-batch16-16-3cpu-start2019-7-28-1520-1.log
CUDA_VISIBLE_DEVICES='7' python sparsity_train-3.py -sr --s 0.001 | tee visualization/sparsity-07trainval-yolov3-a-2-0.001-resize416-batch16-1-2cpu-start2019-8-3-1520-1.log
2.剪枝
CUDA_VISIBLE_DEVICES=9 python new_prune-0.3.py --weights checkpoints-q-1/yolov3_sparsity_416_0.0001_final_1_182.weights --percent 0.5 | tee visualization/prune-0.5-07-12trainval-yolov3-a-resize416-batch16-1-2cpu-start2019-8-4-1500-1.log
3.对剪枝后的weights进行微调
CUDA_VISIBLE_DEVICES='7' python sparsity_train-weitiao.py --cfg prune_yolov3-voc-sparsity-1.cfg --weights checkpoints-q-1/prune_yolov3_sparsity_416_0.0001_final_1_182.weights | tee visualization/weitiao-07-12trainval-yolov3-a-resize416-batch16-1-2cpu-start2019-8-4-1500-1.log
4.微调后进行测试:
4.微调后进行测试:
https://github.com/facebookresearch/Detectron
https://caffe2.ai/docs/tutorials.html
source activate pytorch1.1-cuda9-py3.6
https://github.com/facebookresearch/Detectron/blob/master/INSTALL.md
CUDA_VISIBLE_DEVICES='3,4' python tools/train_net.py --cfg experiment/2gpu_e2e_faster_rcnn_R-50-FPN-voc2007.yaml OUTPUT_DIR out-1 | tee visualization/2gpu_e2e_faster_rcnn_R-50-FPN-voc2007.log
CUDA_VISIBLE_DEVICES=2 python tools/train_net.py --cfg experiments/2gpu_e2e_faster_rcnn_R-50-FPN-voc2007.yaml OUTPUT_DIR out-faster-rcnn-1/train-2 | tee visualization/1gpu_e2e_faster_rcnn_R-50-FPN-voc2007-iter70000-start-7-20-2150.log
2019-7-25:
CUDA_VISIBLE_DEVICES='2,3' python tools/train_net.py --cfg experiments/tutorial_2gpu_e2e_faster_rcnn_R-50-FPN-trainval07+12.yaml OUTPUT_DIR tutorial_2gpu_e2e_faster_rcnn_R-50-FPN/ | tee visualization/tutorial_2gpu_e2e_faster_rcnn_R-50-FPN-trainval07+12-ite60000-1.log
CUDA_VISIBLE_DEVICES='6,7,8' python tools/train_net.py --cfg experiments/e2e_faster_rcnn_R-101-FPN_1x-trainval07+12.yaml OUTPUT_DIR e2e_faster_rcnn_R-101-FPN_1x-trainval07+12/train-3/ | tee visualization/e2e_faster_rcnn_R-101-FPN_1x-trainval07+12-ite90000-start7-26-2040-1.log
CUDA_VISIBLE_DEVICES='6,7' python tools/train_net.py --cfg experiments/e2e_mask_rcnn_R-50-FPN_2x_gn-trainval07+12.yaml OUTPUT_DIR e2e_mask_rcnn_R-50-FPN_2x_gn-trainval07+12/ | tee visualization/e2e_mask_rcnn_R-50-FPN_2x_gn-trainval07+12-start7-27-1200-2gpu-1.log
CUDA_VISIBLE_DEVICES='8,9' python tools/train_net.py --cfg experiments/e2e_faster_rcnn_R-101-FPN_1x-trainval07+12-2gpu.yaml OUTPUT_DIR e2e_faster_rcnn_R-101-FPN_1x-trainval07+12-2gpu/ | tee visualization/e2e_faster_rcnn_R-101-FPN_1x-trainval07+12-2gpu-start7-27-1215-1.log
CUDA_VISIBLE_DEVICES='6,7,8,9' python tools/train_net.py --cfg experiments/e2e_faster_rcnn_R-101-FPN_1x-trainval07+12-4gpu.yaml OUTPUT_DIR e2e_faster_rcnn_R-101-FPN_1x-trainval07+12-4gpu-iter20000/ | tee visualization/e2e_faster_rcnn_R-101-FPN_1x-trainval07+12-4gpu-start7-28-1100-iter20000-1.log
CUDA_VISIBLE_DEVICES=4 python tools/infer_simple.py --cfg experiment/2gpu_e2e_faster_rcnn_R-50-FPN-voc2007.yaml --output-dir out-1/detectron-visualizations/ --image-ext jpg --wts out-1/train/voc_2007_train/generalized_rcnn/model_final.pkl demo | tee visualization/2gpu_e2e_faster_rcnn_R-50-FPN-voc2007-infer-simple.log
CUDA_VISIBLE_DEVICES=4 python tools/test_net.py --cfg experiments/2gpu_e2e_faster_rcnn_R-50-FPN-voc2007.yaml TEST.WEIGHTS out-faster-rcnn-1/train/voc_2007_train/generalized_rcnn/model_final.pkl NUM_GPUS 1 | tee visualization/2gpu_e2e_faster_rcnn_R-50-FPN-voc2007-test_net.log
CUDA_VISIBLE_DEVICES=4 python tools/visualize_results.py --dataset voc_2007_val --detections out-faster-rcnn-1/test/voc_2007_val/generalized_rcnn/detections.pkl --output-dir out-faster-rcnn-1/detectron-visualizations
问题:
FileNotFoundError: [Errno 2] No such file or directory: '/home/xxx/detectron/datasets/data/VOC2007/VOCdevkit2007/results/VOC2007/Main/comp4_80ce9d5d-3ac9-4469-8914-2b6eabc81797_det_val_aeroplane.txt'
新建results/VOC2007/Main文件夹即可
训练:
CUDA_VISIBLE_DEVICES='2,3' python tools/train_net.py --cfg experiments/e2e_mask_rcnn_R-50-FPN_2x_gn.yaml OUTPUT_DIR out-e2e_mask_rcnn_R-50-FPN_2x_gn/ | tee visualization/e2e_mask_rcnn_R-50-FPN_2x_gn-voc2007-iter180000-start-7-21-1135.log
CUDA_VISIBLE_DEVICES='4,5' python tools/train_net.py --cfg experiments/e2e_mask_rcnn_R-101-FPN_1x.yaml OUTPUT_DIR out-e2e_mask_rcnn_R-101-FPN_1x/ | tee visualization/e2e_mask_rcnn_R-101-FPN_1x-voc2007-iter90000-start-7-21-1935.log
CUDA_VISIBLE_DEVICES=8 ./darknet detector train cfg/voc-y.data cfg/yolov3-voc-y.cfg darknet53.conv.74 -map
原版训练:
CUDA_VISIBLE_DEVICES=3 ./darknet detector train cfg/voc-y.data cfg/yolov3-voc-y.cfg backup-y/yolov3-voc-y_2500.weights | tee visualization/train-yolov3-1.log
CUDA_VISIBLE_DEVICES=4 ./darknet detector train cfg/voc-y.data cfg/yolov3-voc-y.cfg | tee visualization/train-yolov3-1.log
CUDA_VISIBLE_DEVICES=4 ./darknet detector train cfg/voc-y.data cfg/yolov3-voc-y.cfg backup/yolov3-voc-y_last.weights 2>1 | tee visualization/darknet-y-batch64-16-voc07-train5011-iteration16767-02.log
voc2007+12trainval训练:
./darknet detector train cfg/voc-y.data cfg/yolov3-voc-y.cfg darknet53.conv.74 -gpus 4,5 | tee visualization/darknet-y-batch128-32-voc0712trainval-iteration-start7-24-1300-01.log
./darknet detector train cfg/voc-y.data cfg/yolov3-voc-y.cfg backup/yolov3-voc-y_last.weights -gpus 4,5 | tee visualization/darknet-y-batch128-32-voc0712trainval-iteration-start7-24-1300-02.log
计算map:
./darknet detector map cfg/voc-y.data cfg/yolov3-voc-y.cfg backup/yolov3-voc-y_41000.weights | tee visualization/darknet-voc2007-bach64-16-20lei-iteration41000-prcurves-points-41000weights.log
CUDA_VISIBLE_DEVICES='7' ./darknet detector map cfg/voc-y.data cfg/yolov3-voc-y.cfg backup/yolov3-voc-y_final.weights | tee visualization/darknet-a-y-batch128-32-voc0712trainval-iteration60200-test-1.log
原版检测单张图片:
CUDA_VISIBLE_DEVICES=8 ./darknet detector test ./cfg/voc-y.data ./cfg/yolov3-voc-y.cfg ./yolov3.weights data/dog.jpg
训练:
CUDA_VISIBLE_DEVICES=4 ./darknet detector train cfg/voc2001.data cfg/yolov3-voc2001.cfg darknet53.conv.74 | tee visualization/darknet-voc2001-bach64-32-2lei-train5011-iteration.log
计算map:
./darknet detector map cfg/voc2001.data cfg/yolov3-voc2001.cfg backup/yolov3-voc2001_5000.weights | tee visualization/darknet-voc2001-bach64-32-2lei-trainval904-iteration-5000weights.log
./darknet detector map cfg/voc2001.data cfg/yolov3-voc2001.cfg backup/yolov3-voc2001_4000.weights | tee visualization/darknet-voc2001-bach64-32-2lei-trainval904-iteration5000-4000weights.log
./darknet detector map cfg/voc2001.data cfg/yolov3-voc2001.cfg backup/yolov3-voc2001_3000.weights | tee visualization/darknet-voc2001-bach64-32-2lei-trainval904-iteration5000-3000weights.log
./darknet detector map cfg/voc2001.data cfg/yolov3-voc2001.cfg backup/yolov3-voc2001_5000.weights -points 11 | tee visualization/darknet-voc2001-bach64-32-2lei-trainval904-iteration-prcurves-11points-5000weights.log
检测单张图片:
./darknet detector test cfg/voc2001.data cfg/yolov3-voc2001.cfg backup/yolov3-voc2001_last.weights data/000001.jpg | tee visualization/darknet-voc2001-bach64-32-2lei-trainval904-iteration5000-000001-jpg.log
训练:
CUDA_VISIBLE_DEVICES=5 ./darknet detector train cfg/voc2001.data cfg/yolov2-voc2001.cfg darknet19_448.conv.23 | tee visualization/darknet-v2-voc2001-batch64-16-trainval904-iteration-start6-30-22:58-01.log
计算map:
./darknet detector map cfg/voc2001.data cfg/yolov2-voc2001.cfg backup/yolov2-voc2001_4000.weights | tee visualization/darknet-v2-voc2001-bach64-32-2lei-trainval904-iteration5000-4000weights.log
./darknet detector map cfg/voc2001.data cfg/yolov2-voc2001.cfg backup/yolov2-voc2001_final.weights | tee visualization/darknet-v2-voc2001-bach64-32-2lei-trainval904-iteration5000-finalweights.log
检测单张图片:
./darknet detector test cfg/voc2001.data cfg/yolov2-voc2001.cfg backup/yolov2-voc2001_last.weights data/000002.jpg | tee visualization/darknet-voc2001-bach64-32-2lei-trainval904-iteration5000-000002-jpg.log
CUDA_VISIBLE_DEVICES=8 python train.py | tee visualization/train-ssd300-voc07-batch32-classes21-iter-04.log
稀疏化:
CUDA_VISIBLE_DEVICES=9 python sparsity_train-3.py | tee visualization/sparsity-train-yolov3-voc07trainval--02.log
剪枝:
CUDA_VISIBLE_DEVICES=9 python new_prune-0.3.py --weights checkpoints-3/yolov3_sparsity_416_0.0001_final_1_410.weights
训练:
CUDA_VISIBLE_DEVICES=4 python trainval_net.py --bs 10 --cuda --checkepoch 13 --checkpoint 1001 --use_tfb | tee visualization/faster-rcnn-voc07-trainval-iteration-01.log
测试:
CUDA_VISIBLE_DEVICES=4 python test_net.py --checkepoch 20 --checkpoint 1001 --cuda | tee visualization/faster-rcnn-voc07-trainval-checkepoch-20-checkpoint-1001-01.log
2、自己数据集
训练:
python setup.py build develop
CUDA_VISIBLE_DEVICES=4 python trainval_net.py --bs 5 --cuda --use_tfb | tee visualization/faster-rcnn-voc2001-trainval-bs5-iteration-01.log
测试:
CUDA_VISIBLE_DEVICES=4 python test_net.py --checkepoch 20 --checkpoint 179 --cuda | tee visualization/faster-rcnn-voc2001-test275-checkepoch-20-checkpoint-179-01.log
1、Getting Started
anaconda创建pytorch1.1虚拟环境:
source activate pytorch
退出pytorch1.1虚拟环境:
conda deactivate
conda create --name cornerNet_Lite-y --file conda_packagelist.txt --channel pytorch
https://conda.anaconda.org/pytorch/linux-64/pytorch-1.0.0-py3.7_cuda10.0.130_cudnn7.4.1_1.tar.bz2
原文:https://blog.csdn.net/u014236392/article/details/81127537
作者:西红柿煎鸡蛋
链接:https://www.pythonheidong.com/blog/article/10708/37b9aab6cb4680810f18/
来源:python黑洞网
任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任
昵称:
评论内容:(最多支持255个字符)
---无人问津也好,技不如人也罢,你都要试着安静下来,去做自己该做的事,而不是让内心的烦躁、焦虑,坏掉你本来就不多的热情和定力
Copyright © 2018-2021 python黑洞网 All Rights Reserved 版权所有,并保留所有权利。 京ICP备18063182号-1
投诉与举报,广告合作请联系vgs_info@163.com或QQ3083709327
免责声明:网站文章均由用户上传,仅供读者学习交流使用,禁止用做商业用途。若文章涉及色情,反动,侵权等违法信息,请向我们举报,一经核实我们会立即删除!