mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-08 22:35:09 +00:00
reduce peak GPU memory usage before training
This commit is contained in:
@@ -471,7 +471,7 @@ class AttentionLinears(nn.Module):
|
||||
num_heads: int = 8,
|
||||
qkv_bias: bool = False,
|
||||
pre_only: bool = False,
|
||||
qk_norm: str = None,
|
||||
qk_norm: Optional[str] = None,
|
||||
):
|
||||
super().__init__()
|
||||
self.num_heads = num_heads
|
||||
|
||||
@@ -2410,6 +2410,7 @@ def is_disk_cached_latents_is_expected(reso, npz_path: str, flip_aug: bool, alph
|
||||
|
||||
|
||||
# 戻り値は、latents_tensor, (original_size width, original_size height), (crop left, crop top)
|
||||
# TODO update to use CachingStrategy
|
||||
def load_latents_from_disk(
|
||||
npz_path,
|
||||
) -> Tuple[Optional[np.ndarray], Optional[List[int]], Optional[List[int]], Optional[np.ndarray], Optional[np.ndarray]]:
|
||||
|
||||
Reference in New Issue
Block a user