[Bug]: ZeroDivisionError
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
Preparing dataset... 0it [00:00, ?it/s] 0%| | 0/10000 [00:00<?, ?it/s] Error completing request Arguments: ('sakimichan', 0.005, 'C:\Users\jijun\Documents\output', 'C:\Users\jijun\Documents\log', 10000, 500, 500, 'C:\Users\jijun\Documents\stable-diffusion-webui\textual_inversion_templates\style_filewords.txt') {} Traceback (most recent call last): File "C:\Users\jijun\Documents\stable-diffusion-webui\modules\ui.py", line 158, in f res = list(func(*args, **kwargs)) File "C:\Users\jijun\Documents\stable-diffusion-webui\webui.py", line 65, in f res = func(*args, **kwargs) File "C:\Users\jijun\Documents\stable-diffusion-webui\modules\textual_inversion\ui.py", line 29, in train_embedding embedding, filename = modules.textual_inversion.textual_inversion.train_embedding(*args) File "C:\Users\jijun\Documents\stable-diffusion-webui\modules\textual_inversion\textual_inversion.py", line 204, in train_embedding for i, (x, text) in pbar: File "C:\Users\jijun\Documents\stable-diffusion-webui\python\lib\site-packages\tqdm\std.py", line 1195, in iter for obj in iterable: File "C:\Users\jijun\Documents\stable-diffusion-webui\modules\textual_inversion\dataset.py", line 71, in getitem if i % len(self.dataset) == 0: ZeroDivisionError: integer division or modulo by zero
Steps to reproduce the problem
- Go to textual inversion
- Press train
- Error
What should have happened?
GPU will train my images and produce a .pt file.
Commit where the problem happens
not sure
What platforms do you use to access UI ?
Windows
What browsers do you use to access the UI ?
Microsoft Edge
Command Line Arguments
No response
Additional information, context and logs
No response
Since the problematic line is if i % len(self.dataset) == 0:, and the error is ZeroDivisionError: integer division or modulo by zero, we can infer that len(self.dataset) is 0, which, the length of one's dataset intuitively should not be 0. What is your intended dataset? Can you verify that the directory pointing to it is correct, and is indeed full of your training images?