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

release: minor follow-up fixes #628

Merged
merged 8 commits into from
Aug 4, 2024
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions TUTORIAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,7 @@ Here's a breakdown of what each environment variable does:

#### Data Locations

- `BASE_DIR`, `OUTPUT_DIR`: Directories for the training data, instance data, and output models.
- `BASE_DIR` - Used for populating other variables, mostly.
- `OUTPUT_DIR` - Where the model pipeline results are stored during training, and after it completes.
- `OUTPUT_DIR` - Where the model pipeline results are stored during training, and after it completes.

#### Training Parameters

Expand Down
7 changes: 6 additions & 1 deletion 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,6 +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

logger.debug(
f"Found existing config (version={current_config_version}): {prev_config}"
)
Expand Down Expand Up @@ -883,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 @@ -975,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
21 changes: 20 additions & 1 deletion helpers/image_manipulation/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from io import BytesIO
from typing import Union, IO, Any

import cv2
import numpy as np

from PIL import Image, PngImagePlugin
Expand All @@ -12,6 +11,26 @@
logger = logging.getLogger(__name__)
logger.setLevel(logging.WARNING)

try:
import cv2
except Exception as e:
if "libGL" in str(e):
print(
"An error occurred while importing OpenCV2 due to a missing LibGL dependency on your system or container."
" Unfortunately, this is not a dependency that SimpleTuner can include during install time."
"\nFor Ubuntu systems, you can typically resolve this by running the following command:\n"
"sudo apt-get install libgl1-mesa-glx"
"\nor, if that does not work:\n"
"sudo apt-get install libgl1-mesa-dri"
"\nIf all else fails, you may need to contact the support department for your chosen platform."
" You can find the full error message at the end of debug.log inside the SimpleTuner directory."
)
from sys import exit

exit(1)
else:
raise e


LARGE_ENOUGH_NUMBER = 100
PngImagePlugin.MAX_TEXT_CHUNK = LARGE_ENOUGH_NUMBER * (1024**2)
Expand Down
Loading
Loading