glenn-jocher commited on
Commit
dd7f0b7
·
unverified ·
1 Parent(s): 683cefe

Fix TypeError: 'PosixPath' object is not iterable (#3285)

Browse files
Files changed (1) hide show
  1. train.py +1 -1
train.py CHANGED
@@ -419,7 +419,7 @@ def train(hyp, opt, device, tb_writer=None):
419
  # Test best.pt
420
  logger.info('%g epochs completed in %.3f hours.\n' % (epoch - start_epoch + 1, (time.time() - t0) / 3600))
421
  if opt.data.endswith('coco.yaml') and nc == 80: # if COCO
422
- for m in (last, best) if best.exists() else (last): # speed, mAP tests
423
  results, _, _ = test.test(opt.data,
424
  batch_size=batch_size * 2,
425
  imgsz=imgsz_test,
 
419
  # Test best.pt
420
  logger.info('%g epochs completed in %.3f hours.\n' % (epoch - start_epoch + 1, (time.time() - t0) / 3600))
421
  if opt.data.endswith('coco.yaml') and nc == 80: # if COCO
422
+ for m in [last, best] if best.exists() else [last]: # speed, mAP tests
423
  results, _, _ = test.test(opt.data,
424
  batch_size=batch_size * 2,
425
  imgsz=imgsz_test,