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

FluxTrainLoop - text encoder - 'NoneType' object has no attribute 'to' #102

Open
SPOOKEXE opened this issue Dec 1, 2024 · 4 comments
Open

Comments

@SPOOKEXE
Copy link

SPOOKEXE commented Dec 1, 2024

2024-12-02T00:05:00.870357 -                     INFO     text_encoder [0] dtype: torch.float8_e4m3fn, device: cuda:0           train_network.py:1067
2024-12-02T00:05:00.873386 -                     INFO     text_encoder [1] dtype: torch.float16, device: cpu                    train_network.py:1067
2024-12-02T00:05:01.178265 - 
Epoch 1/9 - steps:   0%|                                                                      | 0/1000 [00:00<?, ?it/s]2024-12-02T00:05:01.303196 - 2024-12-02 00:05:01 ERROR    !!! Exception during processing !!! 'NoneType' object has no attribute     execution.py:392
                             'to'                                                                                       
2024-12-02T00:05:01.312193 -                     ERROR    Traceback (most recent call last):                                         execution.py:393
                               File "C:\Users\Administrator\Desktop\ComfyUI\execution.py", line 323, in                 
                             execute                                                                                    
                                 output_data, output_ui, has_subgraph = get_output_data(obj,                            
                             input_data_all, execution_block_cb=execution_block_cb,                                     
                             pre_execute_cb=pre_execute_cb)                                                             
                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                 
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                 
                             ^                                                                                          
                               File "C:\Users\Administrator\Desktop\ComfyUI\execution.py", line 198, in                 
                             get_output_data                                                                            
                                 return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION,                 
                             allow_interrupt=True, execution_block_cb=execution_block_cb,                               
                             pre_execute_cb=pre_execute_cb)                                                             
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                 
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                 
                             ^^^^^^^^^^^^^^^^^^                                                                         
                               File "C:\Users\Administrator\Desktop\ComfyUI\execution.py", line 169, in                 
                             _map_node_over_list                                                                        
                                 process_inputs(input_dict, i)                                                          
                               File "C:\Users\Administrator\Desktop\ComfyUI\execution.py", line 158, in                 
                             process_inputs                                                                             
                                 results.append(getattr(obj, func)(**inputs))                                           
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                            
                               File                                                                                     
                             "C:\Users\Administrator\Desktop\ComfyUI\custom_nodes\ComfyUI-FluxTrainer\n                 
                             odes.py", line 837, in train                                                               
                                 steps_done = training_loop(                                                            
                                              ^^^^^^^^^^^^^^                                                            
                               File                                                                                     
                             "C:\Users\Administrator\Desktop\ComfyUI\custom_nodes\ComfyUI-FluxTrainer\t                 
                             rain_network.py", line 1166, in training_loop                                              
                                 encoded_text_encoder_conds = [c.to(weight_dtype) for c in                              
                             encoded_text_encoder_conds]                                                                
                                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                 
                             ^^^^^^^^^^^^^^^                                                                            
                               File                                                                                     
                             "C:\Users\Administrator\Desktop\ComfyUI\custom_nodes\ComfyUI-FluxTrainer\t                 
                             rain_network.py", line 1166, in <listcomp>                                                 
                                 encoded_text_encoder_conds = [c.to(weight_dtype) for c in                              
                             encoded_text_encoder_conds]                                                                
                                                               ^^^^                                                     
                             AttributeError: 'NoneType' object has no attribute 'to'                                    
                                                                                                                        
2024-12-02T00:05:01.320190 -                     INFO     Prompt executed in 119.99 seconds                                               main.py:139```
@SPOOKEXE
Copy link
Author

SPOOKEXE commented Dec 1, 2024

For repository code at commit 688482c (most recent as of this message)

@SPOOKEXE
Copy link
Author

SPOOKEXE commented Dec 1, 2024

Transformer = flux1-dev.safetensors
Vae = ae.safetensors
clip_l = clip_l.safetensors
t5 = t5xxl_fp16.safetensors

@SPOOKEXE
Copy link
Author

SPOOKEXE commented Dec 1, 2024

@SPOOKEXE SPOOKEXE changed the title FluxTrainLoop - 'NoneType' object has no attribute 'to' FluxTrainLoop - text encoder - 'NoneType' object has no attribute 'to' Dec 1, 2024
@SPOOKEXE
Copy link
Author

SPOOKEXE commented Dec 1, 2024

For those wanting a temporary fix, set "train_text_encoder" to false

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