本文目录
Condlnst模型简介
CondInst是一个简单但有效的实例分割框架。它消除了ROI裁剪和与实例感知遮罩头的特征对齐。因此,CondInst可以解决完全卷积网络的实例分割问题。CondInst能够生成高分辨率的实例掩码,而无需更长的计算时间。大量实验表明,CondInst比Mask R-CNN具有更好的性能和推理速度。它可以作为以前基于ROI的实例分割方法的有力替代。
论文点这里:论文地址!
平台的选择:极链AI云
优势特点:与很多平台不同,按小时计费;服务器GPU类型多样,选择多,数量多;有短期的暑期优惠和长期的学生优惠可以选择,非常的实惠!!!
贴一个极链AI云的官网:https://cloud.videojj.com
本文引用的github相关
AdelaiDet toolkit 地址:点这里跳转AdelaiDet
Detectron2 地址:点这里跳转Detectron2
所需配置
训练模型
1.数据集准备(以coco2014为例)
创建coco文件夹路径:
mkdir /root/AdelaiDet/datasets/coco
建立极链平台公共数据集与coco文件夹的软连接:
build coco2014 link:
ln -s /datasets/coco2014/train2014 /root/AdelaiDet/datasets/coco/train2014
ln -s /datasets/coco2014/test2014 /root/AdelaiDet/datasets/coco/test2014
ln -s /datasets/coco2014/val2014 /root/AdelaiDet/datasets/coco/val2014
ln -s /datasets/coco2014/annotations /root/AdelaiDet/datasets/coco/annotations
此处换成coco2017也可以,注意检查公共数据集的格式和位置!!!
2.修改yaml配置文件:
修改yaml文件
修改root/AdelaiDet/configs/Condlnst/Base-Condlnst.yaml中:
DATASETS:
TRAIN: (“coco_2014_train”,)
TEST: (“coco_2014_val”,)
3.用 COCO2014 跑Condlnst:
GPU数量可以根据需求选择。
OMP_NUM_THREADS=1 python tools/train_net.py \
--config-file configs/CondInst/MS_R_50_1x.yaml \
--num-gpus 8 \
OUTPUT_DIR training_dir/CondInst_MS_R_50_1x
具体usage,按需调整:
usage: train_net.py [-h] [--config-file FILE] [--resume] [--eval-only] [--num-gpus NUM_GPUS] [--num-machines NUM_MACHINES] [--machine-rank MACHINE_RANK] [--dist-url DIST_URL] ...
positional arguments:
opts Modify config options at the end of the command. For Yacs configs, use space-separated "PATH.KEY VALUE" pairs. For python-based LazyConfig, use
"path.key=value".
optional arguments:
-h, --help show this help message and exit
--config-file FILE path to config file
--resume Whether to attempt to resume from the checkpoint directory. See documentation of `DefaultTrainer.resume_or_load()` for what it means.
--eval-only perform evaluation only
--num-gpus NUM_GPUS number of gpus *per machine*
--num-machines NUM_MACHINES
total number of machines
--machine-rank MACHINE_RANK
the rank of this machine (unique per machine)
--dist-url DIST_URL initialization URL for pytorch distributed backend. See https://pytorch.org/docs/stable/distributed.html for details.
Examples:
Run on single machine:
$ tools/train_net.py --num-gpus 8 --config-file cfg.yaml
Change some config options:
$ tools/train_net.py --config-file cfg.yaml MODEL.WEIGHTS /path/to/weight.pth SOLVER.BASE_LR 0.001
小结
按照步骤即可完成,Condlnst的训练了,整个训练过程较长,花费时间较多。时间紧任务重,估计也是累死服务器里的显卡了,哈哈。