Browse Source

Update caching (#1496)

5.0
Glenn Jocher 4 years ago
parent
commit
0822cda781
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      train.py
  2. +1
    -1
      utils/datasets.py

+ 1
- 1
train.py View File

@@ -412,7 +412,7 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--weights', type=str, default='yolov5s.pt', help='initial weights path')
parser.add_argument('--cfg', type=str, default='', help='model.yaml path')
parser.add_argument('--data', type=str, default='data/coco128.yaml', help='data.yaml path')
parser.add_argument('--data', type=str, default='data/voc.yaml', help='data.yaml path')
parser.add_argument('--hyp', type=str, default='data/hyp.scratch.yaml', help='hyperparameters path')
parser.add_argument('--epochs', type=int, default=300)
parser.add_argument('--batch-size', type=int, default=16, help='total batch size for all GPUs')

+ 1
- 1
utils/datasets.py View File

@@ -365,7 +365,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
cache_path = Path(self.label_files[0]).parent.with_suffix('.cache') # cached labels
if cache_path.is_file():
cache = torch.load(cache_path) # load
if cache['hash'] != get_hash(self.label_files + self.img_files): # dataset changed
if cache['hash'] != get_hash(self.label_files + self.img_files + [cache_path]): # dataset changed
cache = self.cache_labels(cache_path) # re-cache
else:
cache = self.cache_labels(cache_path) # cache

Loading…
Cancel
Save