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

Dataset Balancing issues #12

Closed
Pychnight opened this issue Dec 20, 2022 · 3 comments
Closed

Dataset Balancing issues #12

Pychnight opened this issue Dec 20, 2022 · 3 comments

Comments

@Pychnight
Copy link

seems like there is a small bug with 1.8.5 data set balancing, it seems to do it partially correct.

though it comes up with this error

Traceback (most recent call last): File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\gradio\routes.py", line 321, in run_predict output = await app.blocks.process_api( File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\gradio\blocks.py", line 1006, in process_api result = await self.call_function(fn_index, inputs, iterator, request) File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\gradio\blocks.py", line 847, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\library\dataset_balancing_gui.py", line 58, in dataset_balancing repeats = max(1, round(concept_repeats / images)) ZeroDivisionError: division by zero Traceback (most recent call last): File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\gradio\routes.py", line 321, in run_predict output = await app.blocks.process_api( File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\gradio\blocks.py", line 1006, in process_api result = await self.call_function(fn_index, inputs, iterator, request) File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\gradio\blocks.py", line 847, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\library\dataset_balancing_gui.py", line 58, in dataset_balancing repeats = max(1, round(concept_repeats / images)) ZeroDivisionError: division by zero Traceback (most recent call last): File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\gradio\routes.py", line 321, in run_predict output = await app.blocks.process_api( File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\gradio\blocks.py", line 1006, in process_api result = await self.call_function(fn_index, inputs, iterator, request) File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\gradio\blocks.py", line 847, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\Users\person\OneDrive\Documents\GitHub\kohya_ss\library\dataset_balancing_gui.py", line 58, in dataset_balancing repeats = max(1, round(concept_repeats / images)) ZeroDivisionError: division by zero

@bmaltais
Copy link
Owner

Hummm... possibly a corner case. Is it possible that some of the folders do not contain any images? Or possibly images with an extension that the GUI does not recognise? I will try to balance with an empty folder and see if I can reproduce the issue.

@bmaltais
Copy link
Owner

Found the issue... it does indeed appart when no images are found in a folder... causing a division by zero. Now... why is it not detecting any images is the other question...

@bmaltais
Copy link
Owner

Issue should be fixed by: #14

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

2 participants