SimpleTuner icon indicating copy to clipboard operation
SimpleTuner copied to clipboard

Failed for validation of flux

Open bxclib2 opened this issue 6 months ago • 5 comments

Hi, I follow the exactly same procedure and use the example dataset for finetuning flux. This is what i get:

File "/root/tmp/SimpleTuner/helpers/training/validation.py", line 1241, in validate_prompt███████████████████████████████████| 30/30 [00:28<00:00, 1.03it/s] validation_image_results = self.pipeline(**pipeline_kwargs).images File "/root/tmp/conda/envs/flux/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "/root/tmp/SimpleTuner/helpers/models/flux/pipeline.py", line 840, in call image = self.image_processor.postprocess(image, output_type=output_type) File "/root/tmp/conda/envs/flux/lib/python3.10/site-packages/diffusers/image_processor.py", line 643, in postprocess image = self.pt_to_numpy(image) File "/root/tmp/conda/envs/flux/lib/python3.10/site-packages/diffusers/image_processor.py", line 148, in pt_to_numpy images = images.cpu().permute(0, 2, 3, 1).float().numpy() NotImplementedError: Cannot copy out of meta tensor; no data!

                                                                                                                                                                  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.    

Traceback (most recent call last): File "/root/tmp/SimpleTuner/train.py", line 2725, in main() File "/root/tmp/SimpleTuner/train.py", line 2393, in main validation.run_validations(validation_type="intermediary", step=step) File "/root/tmp/SimpleTuner/helpers/training/validation.py", line 866, in run_validations self.finalize_validation(validation_type) File "/root/tmp/SimpleTuner/helpers/training/validation.py", line 1332, in finalize_validation self.vae = self.vae.to("cpu") File "/root/tmp/conda/envs/flux/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1173, in to return self._apply(convert) File "/root/tmp/conda/envs/flux/lib/python3.10/site-packages/torch/nn/modules/module.py", line 779, in _apply module._apply(fn) File "/root/tmp/conda/envs/flux/lib/python3.10/site-packages/torch/nn/modules/module.py", line 779, in _apply module._apply(fn) File "/root/tmp/conda/envs/flux/lib/python3.10/site-packages/torch/nn/modules/module.py", line 804, in _apply param_applied = fn(param) File "/root/tmp/conda/envs/flux/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1166, 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.

bxclib2 avatar Aug 05 '24 06:08 bxclib2