Unverified 提交 e9b3de46 authored 作者: train255's avatar train255 提交者: GitHub

Unique *.cache filenames fix (#2134)

* fix #2121 * Update test.py * Update train.py * Update autoanchor.py * Update datasets.py * Update log_dataset.py * Update datasets.py Co-authored-by: 's avatarGlenn Jocher <glenn.jocher@ultralytics.com>
上级 4bdc5a39
...@@ -372,7 +372,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing ...@@ -372,7 +372,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
# Check cache # Check cache
self.label_files = img2label_paths(self.img_files) # labels self.label_files = img2label_paths(self.img_files) # labels
cache_path = Path(self.label_files[0]).parent.with_suffix('.cache') # cached labels cache_path = (p if p.is_file() else Path(self.label_files[0]).parent).with_suffix('.cache') # cached labels
if cache_path.is_file(): if cache_path.is_file():
cache = torch.load(cache_path) # load cache = torch.load(cache_path) # load
if cache['hash'] != get_hash(self.label_files + self.img_files) or 'results' not in cache: # changed if cache['hash'] != get_hash(self.label_files + self.img_files) or 'results' not in cache: # changed
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论