assert args.out or args.show or args.json_out, \
('Please specify at least one operation (save or show the results) '
'with the argument "--out" or "--show" or "--json_out"')
if args.out is not None and not args.out.endswith(('.pkl', '.pickle')):
raise ValueError('The output file must be a pkl file.')
if args.json_out is not None and args.json_out.endswith('.json'):
args.json_out = args.json_out[:-5]
注释了
只要还是改网络结构,细枝末节不用考虑太多
For non-distributed training, there is no validation yet. Eval hooks are only available for distributed training. I noted that this is an expected feature for users with only a single GPU, and will implement an evaluation hook for non-distributed mode.
Batch_size = imgs_per_gpu * num of gpu you used
pretrained='torchvision://resnet50语句会在.cache/torch/checkpoints文件夹下下载一个权重文件,这是pytorch版本的res50预训练权重文件
mmdetection的显存占用较大,后期很可能面临服务器不能跑的情况,所以实验选用batchsize=2
把该调整的超参都调整一遍,尽快着手实验
既然要做图像分割,最好把U-net加进来做对比实验
配置新工程,需要修改的部分如下:
mmdet/datasets/coco.py
将CLASSES改成CLASSES = (‘nodule’,)
configs文件夹下.py配置文件的路径修改
train=dict(
type=dataset_type,
ann_file=data_root + ‘annotations/instances_train2014.json’,
img_prefix=data_root + ‘train2014/’,
pipeline=train_pipeline),
test=dict(
type=dataset_type,
ann_file=data_root + ‘annotations/instances_val2014.json’,
img_prefix=data_root + ‘val2014/’,
pipeline=test_pipeline))
一些值得注意的参数
anchor_scales=[2]
lr = 0.001
scale 从512被resize到了800
seed = 7 这次random不会随着config改变
因为医学影像对准确率要求较高,所以选用ap75作为主要的评价指标
特别注意:修改完成后需要重新编译框架,执行