前期准备:
1 下载COCO2017数据集,数据集地址为:http://cocodataset.org/#download](http://cocodataset.org/#download
解压至
2 安装要求的环境 pip install -r requirements.txt
## Training
训练
Training consists of 3 steps (given AP values for full validation dataset):
训练由三个步骤组成(给定全验证集的AP值)
* Training from MobileNet weights. Expected AP after this step is ~38%.
从MobileNet 权重开始训练,经过此步骤期待AP约为38%
* Training from weights, obtained from previous step. Expected AP after this step is ~39%.
从上一步骤得到的权重训练,经过此步骤期待AP约为39%
* Training from weights, obtained from previous step and increased number of refinement stages to 3 in network. Expected AP after this step is ~40% (for the network with 1 refinement stage, two next are discarded).
训练上一步骤得到的权重,增加改善层到3.经过此步骤,期待AP约为40%
1. Download pre-trained MobileNet v1 weights `mobilenet_sgd_68.848.pth.tar` from: [https://github.com/marvis/pytorch-mobilenet](https://github.com/marvis/pytorch-mobilenet) (sgd option). If this doesn't work, download from [GoogleDrive](https://drive.google.com/file/d/18Ya27IAhILvBHqV_tDp0QjDFvsNNy-hv/view?usp=sharing).
下载预训练的MobileNet V1 权重mobilenet_sgd_68.848.pth.tar,地址为[https://github.com/marvis/pytorch-mobilenet](https://github.com/marvis/pytorch-mobilenet) (sgd option). If this doesn't work, download from [GoogleDrive](https://drive.google.com/file/d/18Ya27IAhILvBHqV_tDp0QjDFvsNNy-hv/view?usp=sharing).
2. Convert train annotations in internal format. Run `python scripts/prepare_train_labels.py --labels
转换训练的注释框到内部格式,运行python scripts/prepare_train_labels.py --labels
[OPTIONAL] For fast validation it is recommended to make *subset* of validation dataset. Run `python scripts/make_val_subset.py --labels
3. To train from MobileNet weights, run `python train.py --train-images-folder
从MObileNetV1 权重训练,运行python train.py --train-images-folder
4. Next, to train from checkpoint from previous step, run `python train.py --train-images-folder
5. Finally, to train from checkpoint from previous step and 3 refinement stages in network, run `python train.py --train-images-folder
最终,为了从上一步骤和3 网络调优阶段的断点进行训练,运行run `python train.py --train-images-folder
We did not perform the best checkpoint selection at any step, so similar result may be achieved after less number of iterations.
我们不在任何步骤选择最好的断点,迭代次数少了会导致相似的结果.