Unverified 提交 9ac7d388 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Backwards compatible cache version checks (#3730)

上级 0e2d0d54
......@@ -390,7 +390,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache') # cached labels
if cache_path.is_file():
cache, exists = torch.load(cache_path), True # load
if cache['version'] != 0.3 or cache['hash'] != get_hash(self.label_files + self.img_files):
if cache.get('version') != 0.3 or cache.get('hash') != get_hash(self.label_files + self.img_files):
cache, exists = self.cache_labels(cache_path, prefix), False # re-cache
else:
cache, exists = self.cache_labels(cache_path, prefix), False # cache
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论