You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing an issue when training a flux model using the lora-scripts project (version 1.9.0). The training process crashes with an AttributeError stating that 'NoneType' object has no attribute 'view' when using loss_type = "smooth_l1".
Error Message:
Traceback (most recent call last):
File "A:\funny\flux_train\Lora训练-测试版\lora-scripts-v1.9.0\scripts\dev\flux_train_network.py", line 565, in
trainer.train(args)
File "A:\funny\flux_train\Lora训练-测试版\lora-scripts-v1.9.0\scripts\dev\train_network.py", line 1192, in train
loss = train_util.conditional_loss(
File "A:\funny\flux_train\Lora训练-测试版\lora-scripts-v1.9.0\scripts\dev\library\train_util.py", line 5815, in conditional_loss
huber_c = huber_c.view(-1, 1, 1, 1)
AttributeError: 'NoneType' object has no attribute 'view'
Set up the training environment using the parameters specified above.
Begin training .
The error occurs during the training process.
Investigation and Findings:
The error indicates that huber_c is None, and the code attempts to call huber_c.view(-1, 1, 1, 1), which leads to an AttributeError.
In scripts/dev/train_network.py at line 1187, the get_noise_pred_and_target function from scripts/dev/flux_train_network.py is called.
The get_noise_pred_and_target function returns huber_c as None.
At line 1191 in scripts/dev/train_network.py, the conditional_loss function from scripts/dev/library/train_util.py is called, which attempts to execute huber_c.view(-1, 1, 1, 1).
Since huber_c is None, this results in the AttributeError.
Additional Information:
I observed that this issue seems to occur when training flux models using the huber or smooth_l1 loss types.
Other users in the community have not reported this issue, suggesting it might be specific to my environment or configuration.
I have tried reinstalling the latest version of lora-scripts (v1.10.0), but the problem persists.
I'm not deeply familiar with Python, so I'm uncertain whether the code is intended to call get_noise_pred_and_target from scripts/dev/train_network.py or if conditional_loss should be using a different module (e.g., sd-scripts/library/train_util.py or scripts/stable/library/train_util.py).
It appears that there might be an incorrect reference or import in the code that's causing the wrong function to be called.
Environment:
Operating System: Windows 10 (64-bit)
Python Version: 3.12.2
lora-scripts Version: v1.10.0
Relevant Hardware: NVIDIA RTX 4090
Dependencies: Up-to-date versions as per the lora-scripts installation instructions
Expected Behavior:
The training process should proceed without errors when using loss_type = "smooth_l1" with flux models.
huber_c should be properly initialized and not be None when required.
Actual Behavior:
The training process fails with an AttributeError because huber_c is None and does not have a view method.
Request:
Could you please help identify the cause of this issue?
Is there a possible fix or workaround that I can apply?
Do I need to adjust my training parameters or update any code references?
Thank you for your assistance!
If you need any additional information or logs, please let me know, and I'll be happy to provide them.
The text was updated successfully, but these errors were encountered:
Description:
I'm experiencing an issue when training a flux model using the lora-scripts project (version 1.9.0). The training process crashes with an AttributeError stating that 'NoneType' object has no attribute 'view' when using loss_type = "smooth_l1".
Error Message:
Training Parameters:
Here are the training parameters I'm using:
Steps to Reproduce:
Investigation and Findings:
Additional Information:
Environment:
Expected Behavior:
Actual Behavior:
Request:
Thank you for your assistance!
If you need any additional information or logs, please let me know, and I'll be happy to provide them.
The text was updated successfully, but these errors were encountered: