toshiaki1729 / stable-diffusion-webui-dataset-tag-editor

Extension to edit dataset captions for SD web UI by AUTOMATIC1111
MIT License
691 stars 56 forks source link

AttributeError: 'GeneralConditioner' object has no attribute 'tokenize' #85

Closed ryouxin closed 1 year ago

ryouxin commented 1 year ago

have a bug, how can i fix it?


Traceback (most recent call last):
  File "/home/ipfs10/.local/lib/python3.10/site-packages/gradio/routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
  File "/home/ipfs10/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1323, in process_api
    result = await self.call_function(
  File "/home/ipfs10/.local/lib/python3.10/site-packages/gradio/blocks.py", line 1051, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/home/ipfs10/.local/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/ipfs10/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/home/ipfs10/.local/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/home/ipfs10/new/stable-diffusion/extensions/stable-diffusion-webui-dataset-tag-editor/scripts/tag_editor_ui/block_load_dataset.py", line 80, in load_files_from_dir
    dte_instance.load_dataset(dir, caption_file_ext, recursive, load_caption_from_filename, replace_new_line, interrogate_method, use_interrogator_names, threshold_booru, threshold_waifu, opts.dataset_editor_use_temp_files, kohya_json_path if use_kohya_metadata else None, opts.dataset_editor_max_res)
  File "/home/ipfs10/new/stable-diffusion/extensions/stable-diffusion-webui-dataset-tag-editor/scripts/dataset_tag_editor/dte_logic.py", line 596, in load_dataset
    self.set_tags_by_image_path(img_path, tags)
  File "/home/ipfs10/new/stable-diffusion/extensions/stable-diffusion-webui-dataset-tag-editor/scripts/dataset_tag_editor/dte_logic.py", line 92, in set_tags_by_image_path
    self.construct_tag_infos()
  File "/home/ipfs10/new/stable-diffusion/extensions/stable-diffusion-webui-dataset-tag-editor/scripts/dataset_tag_editor/dte_logic.py", line 682, in construct_tag_infos
    self.tag_tokens[tag] = clip_tokenizer.tokenize(tag, shared.opts.dataset_editor_use_raw_clip_token)
  File "/home/ipfs10/new/stable-diffusion/extensions/stable-diffusion-webui-dataset-tag-editor/scripts/tokenizer/clip_tokenizer.py", line 34, in tokenize
    tokens = shared.sd_model.cond_stage_model.tokenize([text])[0]
  File "/home/ipfs10/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1614, in __getattr__
    raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'GeneralConditioner' object has no attribute 'tokenize'
jszeck commented 1 year ago

same image

geoffpotter commented 1 year ago

Got this error with sdxl, switched back to 1.5 and it went away.

jszeck commented 1 year ago

That did it. Thanks!

ryouxin commented 1 year ago

thank you guys help me, I have resolve this error, have a nice day~