Skip to content

Commit

Permalink
add workaround for 'Some tensors share memory' error kohya-ss#1614
Browse files Browse the repository at this point in the history
  • Loading branch information
kohya-ss committed Sep 28, 2024
1 parent a9aa526 commit 822fe57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions networks/convert_flux_lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ def main(args):
state_dict = convert_ai_toolkit_to_sd_scripts(state_dict)
elif args.src == "sd-scripts" and args.dst == "ai-toolkit":
state_dict = convert_sd_scripts_to_ai_toolkit(state_dict)

# eliminate 'shared tensors'
for k in list(state_dict.keys()):
state_dict[k] = state_dict[k].detach().clone()
else:
raise NotImplementedError(f"Conversion from {args.src} to {args.dst} is not supported")

Expand Down

0 comments on commit 822fe57

Please sign in to comment.