数据集预处理操作:Pysot训练自己数据集前的预处理_Vesper0412的博客-CSDN博客
Pysot源码地址:https://github.com/STVIR/pysot
conda activate pytorch=1.5.1
文件地址:pysot-master/pysot/core/config.py
将原参数更改为:
__C.DATASET.NAMES = ['MY']
__C.DATASET.MY = CN()
__C.DATASET.MY.ROOT = '/crop511'#绝对路径
__C.DATASET.MY.ANNO = '/train.json'#绝对路径
__C.DATASET.MY.FRAME_RANGE = 100
__C.DATASET.MY.NUM_USE = 100000 # repeat until reach NUM_USE
文件地址:pysot-master/pysot/datasets/dataset.py
class SubDataset(object):
def __init__(self, name, root, anno, frame_range, num_use, start_idx):
cur_path = os.path.dirname(os.path.realpath(__file__))
self.name = name
# self.root = os.path.join(cur_path, '../../', root)
#self.anno = os.path.join(cur_path, '../../', anno)
self.root = root
self.anno = anno
文件地址:pysot-master/experiments/siamrpn_r50_l234_dwxcorr_8gpu/config.yaml
DATASET:
NAMES:
# - 'VID'
# - 'YOUTUBEBB'
# - 'COCO'
# - 'DET'
- 'MY'
文件地址:pysot-master/pysot/core/config.py
#绝对路径
__C.TRAIN.PRETRAINED = '/pysot-master/experiments/siamrpn_r50_l234_dwxcorr/model.pth'
文件地址:pysot-master/experiments/siamrpn_r50_l234_dwxcorr_8gpu/config.yaml
第一行内容改成第二行内容
PRETRAINED: 'pretrained_models/resnet50.model'
PRETRAINED: ''
路径:pysot-master/experiments/siamrpn_r50_l234_dwxcorr_8gpu
用了三块GPU
CUDA_VISIBLE_DEVICES=0,1,2
python -m torch.distributed.launch \
--nproc_per_node=3 \
--master_port=2333 \
../../tools/train.py --cfg config.yaml
文件地址:pysot-master/experiments/siamrpn_r50_l234_dwxcorr_8gpu/config.yaml
TRAIN:
EPOCH: 20
START_EPOCH: 0
BATCH_SIZE: 28
BASE_LR: 0.005
CLS_WEIGHT: 1.0
LOC_WEIGHT: 1.2
RESUME: ''#添加checkpoint.pth的绝对路径