mirror of https://github.com/bmaltais/kohya_ss
Fix issue with tensorboard
parent
ca668e805b
commit
92a01a3890
|
|
@ -85,7 +85,7 @@ def caption_images(
|
|||
log.info(f"Executing command: {command_to_run}")
|
||||
|
||||
# Set the environment variable for the Python path
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Run the command in the sd-scripts folder context
|
||||
subprocess.run(run_cmd, env=env, shell=False)
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ def caption_images(
|
|||
)
|
||||
|
||||
# Set up the environment
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class TensorboardManager:
|
|||
|
||||
self.log.info("Starting TensorBoard on port {}".format(self.tensorboard_port))
|
||||
try:
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
self.tensorboard_proc = subprocess.Popen(run_cmd, env=env)
|
||||
except Exception as e:
|
||||
self.log.error("Failed to start Tensorboard:", e)
|
||||
|
|
|
|||
|
|
@ -1485,7 +1485,7 @@ def validate_args_setting(input_string):
|
|||
)
|
||||
return False
|
||||
|
||||
def setup_environment(scriptdir: str):
|
||||
def setup_environment():
|
||||
env = os.environ.copy()
|
||||
env["PYTHONPATH"] = (
|
||||
fr"{scriptdir}{os.pathsep}{scriptdir}/sd-scripts{os.pathsep}{env.get('PYTHONPATH', '')}"
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ def convert_lcm(
|
|||
run_cmd.append("--ssd-1b")
|
||||
|
||||
# Set up the environment
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ def convert_model(
|
|||
# Log the command
|
||||
log.info(" ".join(run_cmd))
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Run the command
|
||||
subprocess.run(run_cmd, env=env, shell=False)
|
||||
|
|
|
|||
|
|
@ -899,7 +899,7 @@ def train_model(
|
|||
|
||||
# log.info(run_cmd)
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Run the command
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ def extract_dylora(
|
|||
str(unit),
|
||||
]
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ def extract_lora(
|
|||
run_cmd.append("--load_tuned_model_to")
|
||||
run_cmd.append(load_tuned_model_to)
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ def extract_lycoris_locon(
|
|||
run_cmd.append(fr"{db_model}")
|
||||
run_cmd.append(fr"{output_name}")
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
|
|
@ -639,7 +639,7 @@ def train_model(
|
|||
log.info(" ".join(run_cmd))
|
||||
|
||||
# Prepare environment variables
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# create images buckets
|
||||
if generate_image_buckets:
|
||||
|
|
@ -677,7 +677,7 @@ def train_model(
|
|||
log.info(" ".join(run_cmd))
|
||||
|
||||
# Copy and modify environment variables
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Execute the command if not just for printing
|
||||
if not print_only:
|
||||
|
|
@ -953,7 +953,7 @@ def train_model(
|
|||
|
||||
# log.info(run_cmd)
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Run the command
|
||||
executor.execute_command(run_cmd=run_cmd, env=env)
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ def caption_images(
|
|||
# Add the directory containing the training data
|
||||
run_cmd.append(fr"{train_data_dir}")
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ def group_images(
|
|||
run_cmd.append("--caption_ext")
|
||||
run_cmd.append(caption_ext)
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
|
|
@ -1282,7 +1282,7 @@ def train_model(
|
|||
)
|
||||
|
||||
# log.info(run_cmd)
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Run the command
|
||||
|
||||
|
|
|
|||
|
|
@ -451,7 +451,7 @@ class GradioMergeLoRaTab:
|
|||
map(str, valid_ratios)
|
||||
) # Convert ratios to strings and include them as separate arguments
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ def merge_lycoris(
|
|||
run_cmd.append("--is_v2")
|
||||
|
||||
# Copy and update the environment variables
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ def resize_lora(
|
|||
if verbose:
|
||||
run_cmd.append("--verbose")
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ def svd_merge_lora(
|
|||
# Log the command
|
||||
log.info(" ".join(run_cmd))
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Run the command
|
||||
subprocess.run(run_cmd, env=env)
|
||||
|
|
|
|||
|
|
@ -916,7 +916,7 @@ def train_model(
|
|||
exclusion=["file_path", "save_as", "headless", "print_only"],
|
||||
)
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Run the command
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ def verify_lora(
|
|||
log.info(f"Executing command: {command_to_run}")
|
||||
|
||||
# Set the environment variable for the Python path
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Run the command using subprocess.Popen for asynchronous handling
|
||||
process = subprocess.Popen(
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ def caption_images(
|
|||
# Add the directory containing the training data
|
||||
run_cmd.append(rf"{train_data_dir}")
|
||||
|
||||
env = setup_environment(scriptdir=scriptdir)
|
||||
env = setup_environment()
|
||||
|
||||
# Reconstruct the safe command string for display
|
||||
command_to_run = " ".join(run_cmd)
|
||||
|
|
|
|||
Loading…
Reference in New Issue