toshiaki1729 / dataset-tag-editor-standalone

WebUI to edit dataset captions for txt2img models
MIT License
129 stars 13 forks source link

AttributeError: module 'PIL.Image' has no attribute 'Resampling' #15

Closed hdroller closed 1 year ago

hdroller commented 1 year ago

When I try to interrogate and image I get the following error. I tried a few different interrogators but no luck. This is on the latest release build.

Traceback (most recent call last): File "H:\SD\dataset-tag-editor-standalone-0.0.2\dataset-tag-editor-standalone-0.0.2\venv\lib\site-packages\gradio\routes.py", line 393, in run_predict output = await app.get_blocks().process_api( File "H:\SD\dataset-tag-editor-standalone-0.0.2\dataset-tag-editor-standalone-0.0.2\venv\lib\site-packages\gradio\blocks.py", line 1069, in process_api result = await self.call_function( File "H:\SD\dataset-tag-editor-standalone-0.0.2\dataset-tag-editor-standalone-0.0.2\venv\lib\site-packages\gradio\blocks.py", line 878, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio_backends_asyncio.py", line 867, in run result = context.run(func, *args) File "H:\SD\dataset-tag-editor-standalone-0.0.2\dataset-tag-editor-standalone-0.0.2\scripts\ui\tab_edit_caption_of_selected_image.py", line 245, in interrogate_selected_image return dte_module.interrogate_image( File "H:\SD\dataset-tag-editor-standalone-0.0.2\dataset-tag-editor-standalone-0.0.2\scripts\dataset_tag_editor\dte_logic.py", line 72, in interrogate_image res = tg.predict(img, threshold_booru) File "H:\SD\dataset-tag-editor-standalone-0.0.2\dataset-tag-editor-standalone-0.0.2\scripts\dataset_tag_editor\tagger.py", line 47, in predict labels = self.tagger_inst.apply(image) File "H:\SD\dataset-tag-editor-standalone-0.0.2\dataset-tag-editor-standalone-0.0.2\scripts\dataset_tag_editor\interrogators\deep_danbooru_tagger.py", line 35, in apply image = utilities.resize_and_fill(image.convert("RGB"), (512, 512)) File "H:\SD\dataset-tag-editor-standalone-0.0.2\dataset-tag-editor-standalone-0.0.2\scripts\utilities.py", line 42, in resize_and_fill resized = resize(image, (resized_w, resized_h)) File "H:\SD\dataset-tag-editor-standalone-0.0.2\dataset-tag-editor-standalone-0.0.2\scripts\utilities.py", line 30, in resize return image.resize(size, resample=Image.Resampling.LANCZOS) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\PIL\Image.py", line 65, in getattr raise AttributeError(f"module '{name}' has no attribute '{name}'") AttributeError: module 'PIL.Image' has no attribute 'Resampling'