blueprint_args_conflictは不要なため削除、shuffleが毎回行われる不具合修正

This commit is contained in:
u-haru
2023-03-26 03:26:55 +09:00
parent 5a3d564a30
commit a4b34a9c3c
6 changed files with 2 additions and 14 deletions

View File

@@ -59,7 +59,6 @@ def train(args):
}
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)
current_epoch = Value('i',0)

View File

@@ -497,15 +497,6 @@ def load_user_config(file: str) -> dict:
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
if __name__ == "__main__":
parser = argparse.ArgumentParser()

View File

@@ -437,8 +437,9 @@ class BaseDataset(torch.utils.data.Dataset):
self.replacements = {}
def set_current_epoch(self, epoch):
if not self.current_epoch == epoch:
self.shuffle_buckets()
self.current_epoch = epoch
self.shuffle_buckets()
def set_current_step(self, step):
self.current_step = step

View File

@@ -54,7 +54,6 @@ def train(args):
}
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)
current_epoch = Value('i',0)

View File

@@ -94,7 +94,6 @@ def train(args):
}
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)
current_epoch = Value('i',0)

View File

@@ -180,7 +180,6 @@ def train(args):
}
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)
current_epoch = Value('i',0)