Cleanup real labels in validate.py, no need to track original, will do that via exteran script

pull/175/head
Ross Wightman 4 years ago
parent ac18adb9c3
commit ecdeb470f2

@ -218,22 +218,17 @@ def validate(args):
loss=losses, top1=top1, top5=top5)) loss=losses, top1=top1, top5=top5))
if real_labels is not None: if real_labels is not None:
real_top1 = real_labels.get_accuracy(k=1) # real labels mode replaces topk values at the end
real_top5 = real_labels.get_accuracy(k=5) top1a, top5a = real_labels.get_accuracy(k=1), real_labels.get_accuracy(k=5)
results = OrderedDict(
top1=round(real_top1, 4), top1_err=round(100 - real_top1, 4),
top5=round(real_top5, 4), top5_err=round(100 - real_top5, 4),
top1_original=round(top1.avg, 4),
top5_original=round(top5.avg, 4))
else: else:
results = OrderedDict( top1a, top5a = top1.avg, top5.avg
top1=round(top1.avg, 4), top1_err=round(100 - top1.avg, 4), results = OrderedDict(
top5=round(top5.avg, 4), top5_err=round(100 - top5.avg, 4)) top1=round(top1a, 4), top1_err=round(100 - top1a, 4),
results.update(OrderedDict( top5=round(top5a, 4), top5_err=round(100 - top5a, 4),
param_count=round(param_count / 1e6, 2), param_count=round(param_count / 1e6, 2),
img_size=data_config['input_size'][-1], img_size=data_config['input_size'][-1],
cropt_pct=crop_pct, cropt_pct=crop_pct,
interpolation=data_config['interpolation'])) interpolation=data_config['interpolation'])
_logger.info(' * Acc@1 {:.3f} ({:.3f}) Acc@5 {:.3f} ({:.3f})'.format( _logger.info(' * Acc@1 {:.3f} ({:.3f}) Acc@5 {:.3f} ({:.3f})'.format(
results['top1'], results['top1_err'], results['top5'], results['top5_err'])) results['top1'], results['top1_err'], results['top5'], results['top5_err']))

Loading…
Cancel
Save