Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: correctly set hash_filenames to true or false for an initial dataset creation #620

Merged
merged 1 commit into from
Aug 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions helpers/data_backend/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,6 @@ def configure_multi_databackend(
info_log(f"Configuring data backend: {backend['id']}")
# Retrieve some config file overrides for commandline arguments, eg. cropping
init_backend = init_backend_config(backend, args, accelerator)
info_log(f"Configured backend: {init_backend}")
StateTracker.set_data_backend_config(
data_backend_id=init_backend["id"],
config=init_backend["config"],
Expand Down Expand Up @@ -730,9 +729,7 @@ def configure_multi_databackend(
if current_config_version is None:
# backwards compatibility for non-versioned config files, so that we do not enable life-changing options.
current_config_version = 1
init_backend["config"]["hash_filenames"] = False
if "hash_filenames" not in prev_config and current_config_version < 2:
init_backend["config"]["hash_filenames"] = False

logger.debug(
f"Found existing config (version={current_config_version}): {prev_config}"
)
Expand Down Expand Up @@ -886,6 +883,9 @@ def configure_multi_databackend(
hash_filenames = init_backend.get("config", {}).get(
"hash_filenames", default_hash_option
)
init_backend["config"]["hash_filenames"] = hash_filenames
StateTracker.set_data_backend_config(init_backend["id"], init_backend["config"])
logger.debug(f"Hashing filenames: {hash_filenames}")

if "deepfloyd" not in StateTracker.get_args().model_type:
info_log(f"(id={init_backend['id']}) Creating VAE latent cache.")
Expand Down Expand Up @@ -978,6 +978,8 @@ def configure_multi_databackend(
)
accelerator.wait_for_everyone()

info_log(f"Configured backend: {init_backend}")

StateTracker.register_data_backend(init_backend)
init_backend["metadata_backend"].save_cache()

Expand Down
Loading