File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -122,8 +122,16 @@ def main():
122
122
if fp16_cfg is not None :
123
123
wrap_fp16_model (model )
124
124
checkpoint = load_checkpoint (model , args .checkpoint , map_location = 'cpu' )
125
- model .CLASSES = checkpoint ['meta' ]['CLASSES' ]
126
- model .PALETTE = checkpoint ['meta' ]['PALETTE' ]
125
+ if 'CLASSES' in checkpoint .get ('meta' , {}):
126
+ model .CLASSES = checkpoint ['meta' ]['CLASSES' ]
127
+ else :
128
+ print ('"CLASSES" not found in meta, use dataset.CLASSES instead' )
129
+ model .CLASSES = dataset .CLASSES
130
+ if 'PALETTE' in checkpoint .get ('meta' , {}):
131
+ model .PALETTE = checkpoint ['meta' ]['PALETTE' ]
132
+ else :
133
+ print ('"PALETTE" not found in meta, use dataset.PALETTE instead' )
134
+ model .PALETTE = dataset .PALETTE
127
135
128
136
efficient_test = False
129
137
if args .eval_options is not None :
Original file line number Diff line number Diff line change @@ -149,6 +149,8 @@ def main():
149
149
PALETTE = datasets [0 ].PALETTE )
150
150
# add an attribute for visualization convenience
151
151
model .CLASSES = datasets [0 ].CLASSES
152
+ # passing checkpoint meta for saving best checkpoint
153
+ meta .update (cfg .checkpoint_config .meta )
152
154
train_segmentor (
153
155
model ,
154
156
datasets ,
You can’t perform that action at this time.
0 commit comments