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

Val loss (sd3 wip) (need help) #1856

Closed
wants to merge 1 commit into from
Closed

Conversation

gesen2egee
Copy link
Contributor

@gesen2egee gesen2egee commented Dec 27, 2024

I want to move the functionality of the validation loss to a new structure so that it can be used, but there is an issue.

Traceback (most recent call last):
File "D:\SDXL\sd-scripts\sdxl_train_network.py", line 228, in
trainer.train(args)
File "D:\SDXL\sd-scripts\train_network.py", line 469, in train
train_dataset_group, val_dataset_group = config_util.generate_dataset_group_by_blueprint(blueprint.dataset_group)
File "D:\SDXL\sd-scripts\venv\lib\site-packages\torch\utils\data\dataset.py", line 350, in getitem
return self.datasets[dataset_idx][sample_idx]
File "D:\SDXL\sd-scripts\library\train_util.py", line 1638, in getitem
input_ids = [ids[0] for ids in self.tokenize_strategy.tokenize(caption)] # remove batch dimension
AttributeError: 'NoneType' object has no attribute 'tokenize'

I'm currently stuck and need assistance.

The plan is to first support it on the sd train network:

(1) Separate a validation dataset, create a validation loss recorder, and use an independent function to calculate the validation loss to eliminate the difference of hyperparameters.
(2) Allow free setting of the number of steps for validation execution and the number of validation set samples to be used.
(3) Use five time steps [10, 350, 500, 650, 990] for averaging, and using apply_debiased_estimation to adjust weight reduce timestep sampling bias .

I would like to know if Kohya has any plans to support validation loss in the future, as it is very useful during training.
If so, these points could serve as a starting point

val loss
@gesen2egee gesen2egee closed this Dec 27, 2024
@rockerBOO rockerBOO mentioned this pull request Jan 3, 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

Successfully merging this pull request may close these issues.

1 participant