Add debug lines

This commit is contained in:
Andras Schmelczer 2024-09-03 22:34:17 +01:00
parent edd92593b7
commit 3160d33c6f
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -66,6 +66,7 @@ class HistogramDataset(Dataset):
edited_histogram, original_histogram = self.read_2_histograms(
cached_data_path, self._bin_count
)
logging.debug(f"Loaded {cached_data_path} from cache")
except:
logging.warning(f"Failed to load {cached_data_path}, regenerating...")
else:
@ -80,11 +81,15 @@ class HistogramDataset(Dataset):
)
if cached_data_path:
self.save_2_histograms(
edited_histogram,
original_histogram,
cached_data_path,
)
try:
self.save_2_histograms(
edited_histogram,
original_histogram,
cached_data_path,
)
logging.debug(f"Saved {cached_data_path} to cache")
except:
logging.warning(f"Failed to save {cached_data_path}")
return (
torch.tensor(edited_histogram, dtype=torch.float).unsqueeze(0),