I updated to the latest version and tried to run SDXL finetuning.
But I get an error:
File "/workspace/kohya_ss/sdxl_train.py", line 775, in <module>
train(args)
File "/workspace/kohya_ss/sdxl_train.py", line 464, in train
loss_recorder = train_util.LossRecorder()
AttributeError: module 'library.train_util' has no attribute 'LossRecorder'
I made a small change to train_util.py to make optimizer_args work:
optimizer_kwargs = {}
if args.optimizer_args is not None and len(args.optimizer_args) > 0:
print(f"args.optimizer_args: {args.optimizer_args}")
optimizer_args = args.optimizer_args
if isinstance(optimizer_args, str):
optimizer_args = [optimizer_args]
for current_arg_string in optimizer_args:
pattern = re.compile(r'(\w+)=([\w\.\,]+)')
args_opt = pattern.findall(current_arg_string)
for key, value in args_opt:
print(f"key: {key}, value: {value}")
try:
# First, attempt to evaluate the value as a literal (e.g., "True" becomes True)
converted_value = ast.literal_eval(value)
except (ValueError, SyntaxError):
# If literal_eval fails, it might be a string representation of a list of floats
if ',' in value:
try:
# Attempt to split the string by commas and convert each part to a float
converted_value = [ast.literal_eval(v.strip()) for v in value.split(',')]
except ValueError:
converted_value = value
else:
converted_value = value
optimizer_kwargs[key] = converted_value
I updated to the latest version and tried to run SDXL finetuning. But I get an error:
The command that I used to run the training with:
Log: LossRecorder_error.txt
I made a small change to train_util.py to make optimizer_args work:
Not sure what's the problem, any suggestions?