mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-09 06:45:09 +00:00
blueprint_args_conflictは不要なため削除、shuffleが毎回行われる不具合修正
This commit is contained in:
@@ -59,7 +59,6 @@ def train(args):
|
|||||||
}
|
}
|
||||||
|
|
||||||
blueprint = blueprint_generator.generate(user_config, args, tokenizer=tokenizer)
|
blueprint = blueprint_generator.generate(user_config, args, tokenizer=tokenizer)
|
||||||
config_util.blueprint_args_conflict(args,blueprint)
|
|
||||||
train_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group)
|
train_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group)
|
||||||
|
|
||||||
current_epoch = Value('i',0)
|
current_epoch = Value('i',0)
|
||||||
|
|||||||
@@ -497,15 +497,6 @@ def load_user_config(file: str) -> dict:
|
|||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def blueprint_args_conflict(args,blueprint:Blueprint):
|
|
||||||
# train_dataset_group.set_current_epoch()とtrain_dataset_group.set_current_step()がWorkerを生成するタイミングで適用される影響で、persistent_workers有効時はずっと一定になってしまうため無効にする
|
|
||||||
# for b in blueprint.dataset_group.datasets:
|
|
||||||
# for t in b.subsets:
|
|
||||||
# if args.persistent_data_loader_workers and (t.params.caption_dropout_every_n_epochs > 0 or t.params.token_warmup_step>0):
|
|
||||||
# print("Warning: %s: --persistent_data_loader_workers option is disabled because it conflicts with caption_dropout_every_n_epochs and token_wormup_step. / caption_dropout_every_n_epochs及びtoken_warmup_stepと競合するため、--persistent_data_loader_workersオプションは無効になります。"%(t.params.image_dir))
|
|
||||||
# # args.persistent_data_loader_workers = False
|
|
||||||
return
|
|
||||||
|
|
||||||
# for config test
|
# for config test
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
|
|||||||
@@ -437,8 +437,9 @@ class BaseDataset(torch.utils.data.Dataset):
|
|||||||
self.replacements = {}
|
self.replacements = {}
|
||||||
|
|
||||||
def set_current_epoch(self, epoch):
|
def set_current_epoch(self, epoch):
|
||||||
self.current_epoch = epoch
|
if not self.current_epoch == epoch:
|
||||||
self.shuffle_buckets()
|
self.shuffle_buckets()
|
||||||
|
self.current_epoch = epoch
|
||||||
|
|
||||||
def set_current_step(self, step):
|
def set_current_step(self, step):
|
||||||
self.current_step = step
|
self.current_step = step
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ def train(args):
|
|||||||
}
|
}
|
||||||
|
|
||||||
blueprint = blueprint_generator.generate(user_config, args, tokenizer=tokenizer)
|
blueprint = blueprint_generator.generate(user_config, args, tokenizer=tokenizer)
|
||||||
config_util.blueprint_args_conflict(args,blueprint)
|
|
||||||
train_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group)
|
train_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group)
|
||||||
|
|
||||||
current_epoch = Value('i',0)
|
current_epoch = Value('i',0)
|
||||||
|
|||||||
@@ -94,7 +94,6 @@ def train(args):
|
|||||||
}
|
}
|
||||||
|
|
||||||
blueprint = blueprint_generator.generate(user_config, args, tokenizer=tokenizer)
|
blueprint = blueprint_generator.generate(user_config, args, tokenizer=tokenizer)
|
||||||
config_util.blueprint_args_conflict(args,blueprint)
|
|
||||||
train_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group)
|
train_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group)
|
||||||
|
|
||||||
current_epoch = Value('i',0)
|
current_epoch = Value('i',0)
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ def train(args):
|
|||||||
}
|
}
|
||||||
|
|
||||||
blueprint = blueprint_generator.generate(user_config, args, tokenizer=tokenizer)
|
blueprint = blueprint_generator.generate(user_config, args, tokenizer=tokenizer)
|
||||||
config_util.blueprint_args_conflict(args,blueprint)
|
|
||||||
train_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group)
|
train_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group)
|
||||||
|
|
||||||
current_epoch = Value('i',0)
|
current_epoch = Value('i',0)
|
||||||
|
|||||||
Reference in New Issue
Block a user