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

flux lora 训练报错NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device. #607

Open
skygst102 opened this issue Jan 6, 2025 · 0 comments

Comments

@skygst102
Copy link

Traceback (most recent call last):
File "G:\lora-scripts\scripts\dev\flux_train_network.py", line 519, in
trainer.train(args)
File "G:\lora-scripts\scripts\dev\train_network.py", line 402, in train
self.cache_text_encoder_outputs_if_needed(args, accelerator, unet, vae, text_encoders, train_dataset_group, weight_dtype)
File "G:\lora-scripts\scripts\dev\flux_train_network.py", line 209, in cache_text_encoder_outputs_if_needed
unet.to("cpu")
File "G:\lora-scripts\venv\lib\site-packages\torch\nn\modules\module.py", line 1174, in to
return self._apply(convert)
File "G:\lora-scripts\venv\lib\site-packages\torch\nn\modules\module.py", line 780, in _apply
module._apply(fn)
File "G:\lora-scripts\venv\lib\site-packages\torch\nn\modules\module.py", line 805, in _apply
param_applied = fn(param)
File "G:\lora-scripts\venv\lib\site-packages\torch\nn\modules\module.py", line 1167, in convert
raise NotImplementedError(
NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device.
18:18:01-885824 ERROR Training failed / 训练失败

@skygst102 skygst102 changed the title NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device. flux lora 训练报错NotImplementedError: Cannot copy out of meta tensor; no data! Please use torch.nn.Module.to_empty() instead of torch.nn.Module.to() when moving module from meta to a different device. Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant